Skip to content

feat(objectql)!: judge an extension's record-mode amount against its object as served, refusing a bad follow pair at the run that completes it - #33621

Merged
objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/area-E2b-33593
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/area-E2b-33593

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #33593

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/objectstack-data/rules/field-types.md already teaches the follow pair with no extension exemption; an extension now meets that same rule, so the docs do not move.

维护者速读

  • 改了什么:扩展包(objectExtensions / object_extension)新增的 record 币种金额字段,现在按"对象实际对外服务的样子"(基础层 + 已启用扩展 + 本次正文)判定其跟随的父对象币种字段;运行结束、批量写入、单条保存三处同一规则。
  • 为什么改:以前扩展层只判自己的汇总字段就提前返回,坏的跟随对(父字段无币种码、字段不存在、经扩展自建的主从字段)被放行,之后父对象的无改动升级反而被 422 拒绝,错怪了无辜的包。
  • 风险与回滚:收紧(narrowing)——此前能装上的坏扩展现在 422;无改动升级不再因"旧坏对"被拒(放宽)。回滚即回退本 PR;无存量数据迁移(维护者 2026-11-14:暂无生产客户)。另:object_extension 单条保存现在同时经过 D6 汇总门(两个方向),此前存下后只告警的币种汇总改为 422。
  • 先看:packages/objectql/src/registry.ts 的 recordCurrencyFollowRefusalOf / servedFoldWithLayer(折叠与"之前"对比);packages/objectql/src/record-currency-aggregate-door.ts 的 recordCurrencyFollowRefusal(差分判定);packages/metadata-protocol/src/protocol-save.ts 新增的 object_extension 单条保存提问。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run --project local src/manifest-service-artifact-refusal-restores.test.ts src/protocol-batch-object-registration.test.ts,预期全绿,其中 [#33593] 两个 describe 覆盖 R1–R7。
  • 需要你做的:契约复审(Metadata-protocol: narrowed)一次;R7 范围已由席位 5 裁定为 A(只管 install/upgrade/reload 这类 run)。

What changes

The record-currency follow door (ADR-0144 D2 and D6, amended) asked an extend layer with partial: true, judged only its own roll-ups, and returned before the following-amount half and the other-ends half. An extension-only package could therefore add a record-mode amount following a parent field with no ISO 4217 code, a missing field, or a field reached through its own new master_detail, and it was admitted and served; a later no-change upgrade of the parent's owner was then refused 422 over the extension's field.

Implementing the seat ruling (A, amended), R1–R7:

  • R1 — every layer judged as the served fold. SchemaRegistry.recordCurrencyFollowRefusalOf now builds the object as resolveObject would serve it with the incoming layer in its slot (servedFoldWithLayer: one owner, one overlay, one extension per package; a disabled package's extension withheld, as the served fold withholds it) and hands that fold to the door. The door's partial and extensionFieldsOf are gone: the fold already holds every enabled extension's fields, so the own-body loop and the other-ends loop both read them.
  • R2 — an object no owner serves yields no fold, so no verdict (unchanged).
  • R3 — no order is exempt: the owner registering after an extension judges the extension's amounts as its own (the fold), at run end, in the batch writer and on single save.
  • R4 — an extension arriving before the parent's code field exists is refused like an own body.
  • R5 — the followed field is read from the served parent: a missing or disabled supplier extension means refusal; the same supplier in the same artifact passes at the run end.
  • R6 — a parent upgrade that removes or de-codes a followed field is refused; when the amount is an extension's, the sentence now names it: 'PARENT' does not hold the code a registered amount follows: 'CHILD.FIELD', which package 'PKG' adds to 'CHILD'. followed by the door's own words. New view member extensionPackageOf.
  • R7 — a no-change upgrade is never refused. The door now takes a before reading (the object served with what the layer's slot held before) and refuses only a refusal that reading does not already hold. At run end before is the contributor the run replaced (RunRegisteredObject.replaced, captured in registerObject, the earliest kept when a run writes one slot twice); on single save and in the batch writer it is the slot left empty, so a pair the layer itself completes is still refused. The two readings are compared by PAIR, not by sentence: the key is the kind, the declaring object and field, and the target (for a following amount the object its master_detail reaches plus the pointer; for a roll-up the child object and field), so an upgrade that re-points the master_detail onto another parent lacking the code makes a new pair and is refused: for the child's owner as on main; for an extension package re-pointing its own master_detail this moves FROM installed (main never asked an extension layer's following half) TO refused 422.
  • Single save of an object_extension item never asked the follow door (measured on this branch before the hunk: the published save answered 200 and served the bad amount). protocol-save.ts now asks objectRegistrationRefusal(..., 'extend', { againstRegistry: true }) for a published object_extension save on an against-registry face (saveRegistryQuestion), the same faces that ask it of an object body.
  • Changeset (minor: objectql, metadata-protocol, spec) with registered record-currency-follow-extension-judged-as-served, a new semantic ledger entry.

Clause-② table (each moved answer FROM → TO)

Orders: A = owner and parent installed first, extension after; B = extension first (no verdict while nothing owns the object), owner after.

Case Order Run end Batch writer Single save
extension amount follows a parent field with no code A admitted → refused 422 admitted → refused 422 admitted (door never asked) → refused 422
extension amount follows a missing field A admitted → refused 422 admitted → refused 422 (same door, not pinned separately) admitted → refused 422 (same door, not pinned separately)
extension amount through its own new master_detail A admitted → refused 422 admitted → refused 422 (same door, not pinned separately) admitted → refused 422 (same door, not pinned separately)
owner registering under a bad extension B admitted → refused 422 admitted → refused 422 admitted → refused 422
supplier extension missing / disabled A admitted → refused 422 not pinned not pinned
parent upgrade removes / de-codes a followed field — refused → refused (sentence names the extension's package and field) not pinned not pinned
no-change upgrade over a pair a cold boot admitted — refused 422 → installed unchanged (main's empty-slot answer) unchanged (main's empty-slot answer)
unchanged child under a parent's record roll-up a cold boot admitted — refused 422 → installed unchanged (main's empty-slot answer) unchanged (main's empty-slot answer)
extension package's own no-change upgrade over an amount a cold boot admitted — (newly judged) → installed n/a n/a
parent upgrade that only adds an unrelated code field, pair unchanged — refused 422 → installed (pair compared, not the sentence) n/a n/a
upgrade of the child's owner that only re-points the pair's master_detail onto another parent lacking the code, pointer string unchanged — refused 422 → refused 422 (unchanged; the pair key names the followed object) n/a n/a
upgrade of an extension package that only re-points its own master_detail onto another parent lacking the code, pointer string unchanged — installed (main never asked an extension layer's following half) → refused 422 (the pair key names the followed object) n/a n/a
re-publish of an UNCHANGED extension whose amount a cold boot admitted — n/a saved → refused 422 saved (200) → refused 422
object_extension adding a sum/avg/min/max roll-up of a child amount declared currencyMode: 'record' (in each row's own currency, or following a parent's code but not read on that parent through the master_detail it follows), or adding such an amount that a registered parent's roll-up reads (D6's roll-up door, both directions) — unchanged unchanged (already asked) stored, 200, registration warned → refused 422, nothing stored

FROM readings: run end measured on main by the area's earlier report (M1–M3 admitted, C2 refused) and by the two pins this PR flips; single save measured on this branch before the protocol-save.ts hunk; batch writer FROM read from main's door (partial returns before the following half), not separately measured.

CONTROLs (unchanged, pinned): the same amount in an own object body is refused 422; a package that owns the parent and extends the child in one install is refused 422; an extension following the parent's code installs and is served.

Tests

New top-level describes:

  • manifest-service-artifact-refusal-restores.test.ts — [#33593] an extension's record-mode amount is judged against its object as served, at the end of the run: the three bad shapes (refused 422 + nothing left), CONTROL good extension, CONTROL own body, CONTROL parent + extension together, R3 both orders, R4, R5 missing / disabled / same artifact, R6 removal and de-code (sentence names the package and field), R6 an extension upgrade re-pointing its own master_detail onto another bad parent (refused), R7 no-change upgrades of both owners.
  • protocol-batch-object-registration.test.ts — [#33593] an extension's record-mode amount on a single save and in the batch writer: published object_extension save on meta-envelope refused 422 and nothing stored (plus CONTROL), the owner's single-save question in order B, and the batch writer's registered-row question asked of both ends (plus CONTROL).

Moved pins (Clause-② evidence, both renamed with the ruling id): a package that holds only the parent ... upgrade that changes nothing and a package that holds only the child installs an unchanged child under a record roll-up now install (R7); a new CONTROL pins that the child's upgrade that CHANGES the pair under that roll-up is still refused, and another that a child upgrade re-pointing its master_detail onto another bad parent (same pointer string) is still refused. The extension package's own re-point (manifest-service-artifact-refusal-restores.test.ts:982, not a CONTROL) is a moved answer: installed on main, refused 422 here.

Acceptance notes

  • Review Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3 delta-2 (comment 6889470504) fixes, at 31e745afc, text only: M1: the changeset's re-point sentence now scopes "as before" to the child's owner and says the same re-point upgrade of an extension package moves FROM installed (main never asked an extension layer's following half) TO refused 422; this table splits that row in two and the R7 bullet says the same. The TO is held by the existing pin manifest-service-artifact-refusal-restores.test.ts:982. N1: the changeset's R7 parenthetical now gives the key for a following amount and for a roll-up (the declaring object and field, and the child object and field it reads). No code changed; check:adr-0087-registration, check:spec-changes, check:upgrade-guide, check:empty-changeset, check:changeset-fixed, check:nul-bytes: exit 0.

  • Review Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3 delta (comment 6888891782) fixes, at c29899531: M1 (text): the changeset's D6 line, this table's last row and the entry's surface now say the child amount is declared currencyMode: 'record' (in each row's own currency, or following a parent's code but not read on that parent through the master_detail it follows), and name D6's second direction (a registered parent's roll-up over an amount the extension adds); the registry-question.ts header says the same. M2 (code + pin): the follow pair key now carries the object the pointer's master_detail reaches (record-currency-aggregate-door.ts:596, :615); pinned at manifest-service-artifact-refusal-restores.test.ts:601 (child upgrade re-pointing invoice from suite_invoice to suite_other, refused 422, Billing stays at 1.0.0) and :982 (the extension's own inv2 re-pointed, refused 422). Ablation of the own-loop key back to the bare pointer turns exactly those two pins red, restored to HEAD. S1: the BREAKING paragraph names the roll-up author, and the fix sentence and the entry's replacement carry D6's remedies. Nits: N1 (below), N2 ("the first four lines") and N3 (single save 200, batch writer "saved" in its own result) fixed; round-1 nits N1-N3 left.

  • Review Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3 (comment 6888559585) fixes, at f1f49b351: M1 declared (option a): the protocol-save.ts hunk asks D6's roll-up door as well as the follow door, as the batch writer's extension row already did; the changeset, this table, the entry's surface and the registry-question.ts sentence now say so, and a pin holds it (422, nothing stored). M2: R7 compares the refused pair (kind, object, field, pointer or roll-up target), not the sentence, which lists the parent's code fields; pinned: a parent upgrade that only adds cc installs. M3: pinned: the extension package's own no-change upgrade installs (ablation of the extend arm's replaced capture turns exactly that pin red, restored to HEAD). M4: the changeset scopes R7 to runs and adds the unchanged-extension re-publish line for single save and the batch writer.

  • Verification at f1f49b351: pnpm --filter @objectstack/objectql typecheck && pnpm --filter @objectstack/objectql test under os-verify-lock: Test Files 595 passed (595), Tests 13099 passed (13099), VERDICT command-exit 0. The two touched test files: 65/65. check:adr-0087-registration, check:spec-changes, check:upgrade-guide, check:nul-bytes, check:doc-authoring and eslint over the 7 touched source files: exit 0.

  • Main merge: origin/main (with E1's fix(objectql,metadata-protocol)!: a stored row bound to a package lives in that package's own registry slot, so each address serves its own row in every order (ADR-0150 D3/D4) #33513) merged at fb22e7bd1, clean, no conflict in registry.ts; the PR's hunks were byte-identical before and after (review Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3 checked the same).

  • Follow-up: objectql: uninstallPackage, disablePackage and enablePackage never ask the record-currency follow door, so a disabled supplier extension or a re-enabled bad extension can leave a following amount served without judgment #33628 (R5 / enable): whether uninstalling or disabling a supplier extension, and enabling a package, ask the follow door is NOT pinned here. By reading: disablePackage / enablePackage / uninstallPackage are not registration runs (restoringOnRefusal is not entered), so none asks the door; a disable that withholds a supplier's code field leaves a following amount served against a parent that no longer holds the code.

  • Batch writer face is pinned at the registry question the writer asks of a registered row (objectRegistrationRefusal(..., { againstRegistry: true }), as batch-object-registration.ts asks it), not by driving a protocol batch face end to end with an object_extension row.

  • Decided (seat 5): A. R7 covers runs (install, upgrade, reload). Single save and the batch writer are unchanged: they judge against the slot left empty, main's answer, so a single save that re-saves an own body unchanged over a pair a cold boot admitted is still refused.

  • Environment-overlay reading (followRefusalAsServed): an extension layer's own fold uses the served base (the overlay when there is one); only the OTHER objects are re-read through their package definitions.

  • Older ledger entry: 18.record-currency-follow-pair-refused-on-install-and-reload.ts is not edited (a registered entry). The new entry 18.record-currency-follow-extension-judged-as-served.ts names it and says that, for runs, it supersedes that entry's sentence "although nothing in that package is wrong": such a run is now refused only when it changes the pair.

  • packages/metadata-protocol/src/registry-question.ts (E1's file, edited here with E1's OK): one header sentence, comment-only: "An object_extension item published on the same faces asks both record-currency doors too — D6's roll-up half (the roll-ups it adds, and a registered parent's roll-up over an amount it adds), and the follow door of the extension judged as its object will be served."

Verification

Review #3 delta fixes at `c29899531` — objectql full suite + typecheck green, ablation 2 red, gates 0

pnpm --filter @objectstack/objectql typecheck && pnpm --filter @objectstack/objectql test under os-verify-lock, after pnpm --filter '@objectstack/objectql^...' build:

check:test-typecheck: OK — @objectstack/objectql's test layer compiles under packages/objectql/tsconfig.test.json
 Test Files  595 passed (595)
      Tests  13101 passed (13101)
os-verify-lock: VERDICT command-exit 0

The two touched test files: 67/67. packages/spec migrations tests (migrations, semantic-relevance, spec-changes-surface-scope): 187/187.

Ablation: node scripts/ablation-replace.mjs --file packages/objectql/src/record-currency-aggregate-door.ts replacing the own-loop key's target with the bare pointer, then the two test files:

ablation-replace: ok mutation landed: anchor 1 -> 0, blob b6542b7f040a -> 97bc3261cc65
     x [#33593 R6] CONTROL: the child's upgrade that re-points the pair onto ANOTHER parent lacking the code is refused, though the pointer reads the same
     x R6: an extension upgrade that re-points its own master_detail onto ANOTHER parent lacking the code is refused, though the pointer reads the same
      Tests  2 failed | 65 passed (67)
ablation-replace:   blob after restore  b6542b7f040adb49dc374db24baf6211c3ec307d   (== HEAD blob; git diff HEAD empty)

Gates: pnpm check:adr-0087-registration exit 0; pnpm --filter @objectstack/spec check:spec-changes exit 0; check:upgrade-guide exit 0; check:nul-bytes exit 0; eslint --no-inline-config over the four touched source/test files exit 0. Dogfood battery and dependents: not run in this round (ordered after the delta review).

Readings below the first two blocks were taken at bb54e3a54 (merge base c32bb6ccb). The branch then merged origin/main at fb22e7bd1 (E1's #33513 had landed): the merge was clean, with no conflict in registry.ts. After pnpm install --frozen-lockfile and a rebuild of objectql's dependency closure, objectql tsc --noEmit passed, the two touched test files ran 62/62, and the full objectql suite was cut off by a container restart (NOT MEASURED at fb22e7bd1).

objectql: full suite + typecheck — green

pnpm --filter @objectstack/objectql test && pnpm --filter @objectstack/objectql typecheck (under os-verify-lock, at 56474fc2f; the source has not changed since except the JSDoc commit)

 Test Files  595 passed (595)
      Tests  13049 passed (13049)
check:test-typecheck: OK — @objectstack/objectql's test layer compiles under packages/objectql/tsconfig.test.json
os-verify-lock: VERDICT command-exit 0
metadata-protocol: full suite + typecheck — green

pnpm --filter @objectstack/metadata-protocol test && pnpm --filter @objectstack/metadata-protocol typecheck

 Test Files  340 passed | 9 skipped (349)
      Tests  22877 passed | 43 skipped (22920)
os-verify-lock: VERDICT command-exit 0
Ablation (one, the behaviour the new pins hold) — 8 red, restored

node scripts/ablation-replace.mjs --file packages/objectql/src/registry.ts --anchor "if (served === undefined) return undefined;" --replacement "if (served === undefined || ownership === 'extend') return undefined;" (an extend layer judged by nothing, the shape main had for the following half), then the two test files. objectql's tests import the registry from src by relative path, so no build sits between the mutation and the run.

ablation-replace: ok mutation landed: anchor 1 -> 0, blob 09c11d4afe57 -> 3be4c89b9820
 Test Files  2 failed (2)
      Tests  8 failed | 54 passed (62)
  x the three extension-only bad shapes (R1), R4, R5 missing, R5 disabled, single save, batch writer
ablation-replace: ok restored: blob == HEAD (09c11d4afe57) and `git diff HEAD` is empty

Direction as expected: the R3 cases (owner after the extension) stay green under this mutation, because the owner's own layer folds the extension in.

Lint and gates
  • npx eslint --no-inline-config over the six changed files: exit 0.
  • pnpm check:adr-0087-registration: exit 0, registered record-currency-follow-extension-judged-as-served (new here).
  • Derived families (node scripts/pm/dispatch-gates.mjs --commands, 95 commands for 7 paths vs c32bb6ccb): run locally as of this body, all exit 0 except the ones below; the rest are left to CI's Lint & Repo Gates / TypeScript Type Check.
    • re-run after pnpm --filter @objectstack/spec build: check:api-surface (unchanged ✓), check:exported-any, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability: exit 0.
    • check:dual-build-cjs-loads, check:lean-entry-closure: exit 3 (PREREQUISITE NOT MET: no whole-repo build here, nothing measured), NOT MEASURED locally; CI runs them. --ran: 95 derived, 93 run, 2 UNRUN (these two).
    • After the two follow-up commits (the registry-question.ts sentence and the new entry's supersede sentence): the derivation over 8 paths gives the same 95 commands. check:adr-0087-registration, check:spec-changes, check:upgrade-guide, check:liveness, check:nul-bytes, check:doc-authoring, check:issue-citations, check:cross-package-test-inputs and eslint over both files: exit 0.
  • test:repo (vitest repo project, incl. packages/runtime/src/metadata-registry-question-producers.test.ts): NOT MEASURED locally, declared to CI's Test Core. The new saveRegistryQuestion call in protocol-save.ts adds no saveMetaItem / promoteDraftForPublish producer.
  • Direct dependents of objectql (runtime, rest, plugins): NOT MEASURED locally (deadline), declared to CI.
  • Full dogfood battery (title carries !): NOT MEASURED locally, declared to the queue's Dogfood Regression Gate.

Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382

🤖 Generated with Claude Code

…ir as the served fold

The follow door asked an extend layer with partial: true and returned
before the following-amount and other-ends halves, so an extension-only
package could add a record-mode amount following a field with no ISO 4217
code (or no field at all) and a later no-change upgrade of the parent's
owner was refused over it. Every layer is now judged as its object served
with the layer in its slot (base + enabled extensions + the incoming body),
at run end, in the batch writer and on single save; a pair the run leaves
as it found it is not refused, and a parent upgrade that breaks an
extension's amount names the extension's package.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
…single save and batch writer

A published object_extension save on a face that makes it live at once
now asks the follow door too, as the same face asks of an object body.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
…s ADR-0087 ledger entry

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/objectql, @objectstack/spec, touching 29 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/registry-question.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

26 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json f06f0640f739392449357b3cb5fb9725565d5955.

⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/registry-question.ts) — pages documenting those are invisible to this run
  • 7 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f06f0640f739392449357b3cb5fb9725565d5955 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from cb0eacd75cacf7e74777708ae0be6309d0edc564 — the merge of head bd8446859c576a36cea1108cf1877f54296b8758 into base f06f0640f739392449357b3cb5fb9725565d5955, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cb0eacd75cacf7e74777708ae0be6309d0edc564 && git checkout cb0eacd75cacf7e74777708ae0be6309d0edc564
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f06f0640f739392449357b3cb5fb9725565d5955 bd8446859c576a36cea1108cf1877f54296b8758 && git checkout -B drift-repro f06f0640f739392449357b3cb5fb9725565d5955 && git merge --no-ff bd8446859c576a36cea1108cf1877f54296b8758

node scripts/docs-audit/affected-docs.mjs --json f06f0640f739392449357b3cb5fb9725565d5955

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs f06f0640f739392449357b3cb5fb9725565d5955 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382
Request: review (contract) · area E2b · head bb54e3a · Fixes #33593

Ruling A as amended (R1–R7): every record-currency follow layer is judged against its object as served (base + enabled extensions + the incoming layer in its slot). Declared Metadata-protocol: narrowed, ! title, minor changeset, new ADR-0087 semantic entry record-currency-follow-extension-judged-as-served.

Please judge in particular:

  • packages/metadata-protocol/src/protocol-save.ts (+18) is outside the order's file list: a published object_extension single save now asks the follow door. Measured before the hunk: 200, bad amount served.
  • registry.ts hunks outside the three follow-door call sites: registerObject records the contributor its slot replaces and RegistrationRestorePoint keeps the earliest per slot (R7 needs a "before" fold).
  • R7 covers runs only. Single save and the batch writer still judge against the empty slot, so an unchanged own body re-saved over a pair a cold boot admitted is still refused, as on main. Proposed A (leave as is); the alternative B is in the PR's open question.
  • Not measured locally: test:repo, objectql direct dependents, full dogfood battery, check:dual-build-cjs-loads / check:lean-entry-closure (no whole-repo build). The PR body's NOT MEASURED for check:dual-source-exports and check:entry-nameability is stale: both exit 0.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head fb22e7b · 2026-11-15T03:24Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: fb22e7bd1bb99759f3b4998ce1d36206bf21de88
Local-runs: none
Scope: .changeset/33593-extension-follow-judged-as-served.md, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/registry-question.ts, packages/objectql/src/record-currency-aggregate-door.ts, packages/objectql/src/registry.ts, packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts, packages/objectql/src/protocol-batch-object-registration.test.ts, packages/spec/src/migrations/entries/semantic/18.record-currency-follow-extension-judged-as-served.ts

Read: the PR's own commits 4bc1aa0a, 56474fc2, ccd83416, bb54e3a5, 08fdd538, e61155be, and the merge fb22e7bd. The merge brings in origin/main only. I checked that the PR's hunks in registry.ts, record-currency-aggregate-door.ts and protocol-save.ts are byte-identical before and after the merge (git diff c32bb6cc bb54e3a5 against git diff 605d7121 fb22e7bd). I measured the ruling against the text of #33593 (ruling A, amended, R1–R7, and its Acceptance list). Line numbers below are at fb22e7bd. I ran no test, build or gate. Every behaviour below is by reading.

① Derived judgments

R1–R6 match the ruling.

  • recordCurrencyFollowRefusalOf (registry.ts:5866-5904) builds the object as served with the layer in its slot (servedFoldWithLayer, :5907-5924) and hands that fold to the door. The door no longer has partial (record-currency-aggregate-door.ts:536-547), so an extend layer's following amounts and the other-ends loop are both asked (R1, R3, R4).
  • No owner gives no fold, which gives no verdict (registry.ts:5881, R2).
  • A disabled extension is withheld from the fold through withholdDisabledExtensions (R5).
  • The other-ends sentence names the extension's package and field (record-currency-aggregate-door.ts:600-616, R6).
  • Clause-② yes (narrowing) is correct. The PR also moves two answers the other way (refused to installed, R7). That is allowed under the narrowing arm, because narrowing is the dominant kind.

Area point 1: the protocol-save.ts hunk (:1257-1273) is necessary, and it mirrors the batch writer, but it moves one answer more than it declares.

  • Necessary. Without it, a published single save of an object_extension never asks the follow door. The ruling's Acceptance names single save as one of the three faces. The PR body measured 200 and a served bad amount before the hunk.
  • Same shape as the batch writer. It asks exactly what the batch writer already asks of an extension row (batch-object-registration.ts:163-167).
  • It reaches further than the follow door. The call goes through objectRegistrationRefusal(..., 'extend', { againstRegistry: true }) (registry.ts:5738). On a sealed registry that clears bodyOnly, so judgeRegistrationDoors also asks D6's summary door (recordCurrencySummaryRefusal, registry.ts:5820) of the extension body.

must-fix M1: the protocol-save.ts hunk also asks D6's summary door of a published object_extension save. That moved answer is not declared anywhere.

  • On main. objectExtensionItemRefusal asks only extendContributionRefusal and the address checks. An extension that adds a record roll-up D6 refuses, or a record-mode amount that a registered parent rolls up, was stored and answered 200. Its write-through registration then failed with only a console.warn (protocol-registry-hydration.ts:1515-1523).
  • With this PR. The same save is refused 422 and nothing is stored.
  • Not declared. The changeset, the PR's Clause-② table and the new ADR-0087 entry do not mention it. registry-question.ts:16-17 says the item "asks the follow door too", and says nothing of D6.
  • Fix, either one:
    • (a) declare it. Add a FROM → TO line to the changeset and the PR table, extend the entry's surface and the registry-question.ts sentence to D6's roll-up half, and pin one D6-refused object_extension single save (422, nothing stored).
    • (b) narrow the hunk so it asks the follow door alone.
  • I recommend (a): the batch writer already asks both doors of an extension row.

Area point 2: the registry.ts hunks outside the three call sites are necessary and minimal.

  • R7 needs a "before" fold at run end. The run does not know what a slot held unless registerObject records it.
  • The added code is small:
    • one local (:6129),
    • three assignments, one in each replacement arm (own :6176, overlay :6193, extend :6200),
    • one new field on RunRegisteredObject, passed at :6227,
    • noteRegisteredObject (:3938-3942) keeping the earliest replaced for a slot that is written twice. The nested-point merge at :3962 goes through the same method, so the earliest is kept there too.
  • I found nothing in these hunks that is not needed for R7.

must-fix M2: R7's comparison keys on the full refusal message. That message includes the parent's list of code-field candidates, so a run that leaves the pair as it found it can still be refused.

  • The key. followRefusalKey (record-currency-aggregate-door.ts:550-551) is objectName + fieldName + message.
  • Why the message changes. recordCurrencyFollowedCodeError ends with codeFieldCandidates(parentFields) (packages/spec/src/data/record-currency-path.ts:88, :95). That is the list of every ISO 4217 field on the parent.
  • Example. A cold boot admits suite_line.amount following invoice.title. The parent's owner then upgrades and only adds an unrelated code field cc. The "before" reading says "it has none; declare one…". The "served" reading says "candidates: 'cc'". The keys differ, so the upgrade is refused over a pair it did not touch.
  • The texts claim otherwise. The changeset (:24) says "A run is not refused over a pair it leaves as it found it". The entry (:35-39) says such a run "is now refused only when it changes the pair".
  • The wrong package is blamed again. This is the same blame-the-innocent shape that objectql: an extend layer's record-mode currency amount is judged against the object as served, so a bad follow pair is refused at the run that completes it (not at a later no-change upgrade of the parent) #33593 fixes, now triggered by a widening of the parent.
  • Fix, either one:
    • (a) key the comparison on the pair, not the prose: the object, the field, the followed pointer (or roll-up), and the refusal class. Pin the example above (installs).
    • (b) narrow the changeset and entry sentences to "a no-change upgrade".
  • I recommend (a).

must-fix M3: the R7 pins do not cover the extend arm. R1 newly judges extend layers, so R7 must hold for an extension package's own no-change upgrade.

  • The R7 pin (manifest-service-artifact-refusal-restores.test.ts:929-939) upgrades only the two owners (ledger and billing).
  • Nothing upgrades extender unchanged over the amount the cold boot admitted.
  • The line that makes that case pass is replaced = contributors.splice(idx, 1)[0] in the extend arm (registry.ts:6200). By reading, removing that capture would turn no pin red.
  • Add one pin. bootWith([... extender({ ext_amount: follows('invoice.title') })]), then manifest.register(extender({ ...same }, '1.0.1')) installs.

must-fix M4: the changeset puts the R7 line under all three askers, which is false for two of them, and it leaves one moved answer unlisted.

  • The scope. Changeset :18 says the list below applies "at the end of an install / upgrade / reload run, in the batch writer, and on a published single save". The R7 bullet (:24) then says "FROM refused 422 TO installed".
  • Batch writer and single save. Both judge against the empty slot (registry.ts:5843), so an own body re-saved unchanged is still refused there. The PR body says so, and the entry now says so (:39). The changeset, which ships as CHANGELOG, does not.
  • The unlisted moved answer. Under R1 with an empty before, re-publishing an unchanged object_extension (single save, or a package-publish row in the batch writer) over an amount a cold boot admitted moves from admitted (on main the extension's following half was never asked) to refused 422. The first bullet says "adding an amount", which does not cover a re-publish.
  • Fix. Scope the R7 bullet to runs, and add the re-publish line.

Pins against R1–R7.

  • R1 (three shapes at run end, single save, batch writer), R2, R3 (both orders, at all three faces), R4, R5 (missing, disabled, same artifact) and R6 (removal, de-code, the sentence) are each pinned.
  • R7 is pinned for both owners, and a CONTROL pins that an upgrade changing the pair is still refused.
  • M3 is the gap. N2 below is a smaller one.
  • The CONTROLs the ruling asked for are present: an own body, and parent plus extension in one install.

ADR-0087 entry. 18.record-currency-follow-extension-judged-as-served.ts is well-formed: id, surface, replacement, reason, acceptanceCriteria, and no conversionIds, which is correct because there is no D2 conversion.

  • It is discovered by directory, and the changeset carries exactly one marker, registered record-currency-follow-extension-judged-as-served.
  • Lint & Repo Gates, which runs check:adr-0087-registration, was green at bb54e3a5. The merge did not touch this entry or the changeset marker.
  • FROM/TO matches the code, except the two places named in M1 (D6 is missing from surface) and M2 (the "only when it changes the pair" sentence).

② Semver level

minor ×3 is correct.

  • AGENTS.md (§ landing, item 3): a Metadata-protocol kind takes at least minor on every package the diff moves.
  • The diff moves @objectstack/objectql (door and registry), @objectstack/metadata-protocol (save door) and @objectstack/spec (a new semantic entry). The changeset lists all three at minor.
  • The title carries !.
  • The BREAKING paragraph names who is affected: an objectExtensions entry or a stored object_extension item whose record-mode amount follows a bad parent field. It also names the fix: point at a field with valueDomain: 'iso_4217_currency', or install the supplier first or in the same artifact.
  • The paragraph's FROM/TO list needs M1 and M4.

③ Boundary flags

  • Not Tier H, and not governed.
    • The PR file list (8 files, +600/−86 from gh api pulls/33621/files) touches no row of GOVERNED_SURFACES (scripts/pm/check-governed-merges.mjs:1261-1273): no docs/adr/**, .claude/**, skills/**, AGENTS.md, CLAUDE.md or workflow path.
    • It is under the 3,000-changed-line threshold.
    • The Metadata-protocol: narrowed declaration makes it a contract review, not a Tier H landing. Governed Surface Queue Guard is green at fb22e7bd.
  • RecordCurrencyFollowRegistryView loses partial and extensionFieldsOf. It is not exported from packages/objectql/src/index.ts, so the public API does not move.
  • Seat ruling needed: R7 on single save and the batch writer (area point 3; the PR's open question). My review judgment is below. It is not a ruling.
    • Why the text alone does not settle it. R7's text says "upgrade", which in objectql: an extend layer's record-mode currency amount is judged against the object as served, so a bad follow pair is refused at the run that completes it (not at a later no-change upgrade of the parent) #33593 is a run. But R1 says "every layer", and the Acceptance asks for the Clause-② table "at run end, in the batch writer, and on single save".
    • Why it matters now. The batch writer serves "a package publish" (registry.ts objectRegistrationRefusal docblock). This PR makes that face, and single save, newly refuse an unchanged re-publish of an extension over an amount a cold boot admitted (M4).
    • Not a reviewer's call. Whether "upgrade" in R7 covers a package publish or a re-publish is the seat's to rule, not the reviewer's.
    • My recommendation: A (runs only, as built), for two reasons. The batch writer asks after its rows are registered and has no pre-batch contributor. B would split the two askers' meaning.
    • Conditions. The seat should confirm A explicitly before landing, and M4 should declare what A leaves refused.
  • Split-out (the PR's acceptance note): uninstalling, disabling or enabling a supplier extension does not ask the door. The ruling allows "pin, or file separately", so the seat should file the card.
  • CI is not part of this verdict. At fb22e7bd the required checks were still in progress when I read them.

④ Design judgment

The design is right.

  • Judging the served fold instead of the bare body removes a whole exemption class, instead of patching one more case.
  • Comparing against "before" puts the blame on the change, which matches R6's reason.
  • servedFoldWithLayer reuses foldExtenders and withholdDisabledExtensions, so the door and the served read cannot drift apart.

The faults are in three places, and each fix is local:

  • the identity key (M2),
  • one unpinned arm (M3),
  • two declarations that say less (M1) or more (M4) than the code does.

Nits:

  • N1: the body's priority is dropped. Both protocol-save.ts:1269 and batch-object-registration.ts:167 discard it, so the fold sorts the incoming extension at followDoorSlotPriority (registry.ts:5926), not at the priority the write-through will register (registerObjectExtension). This matters only when two extensions add the same field. Pass priority through FollowDoorLayer, or say why it is ignored.
  • N2: nothing pins the overlay arm's replaced capture (registry.ts:6193). One reload pin with an environment overlay over a cold-boot-admitted pair would cover it.
  • N3: protocol-save.ts:1263 declares an inline structural type for objectRegistrationRefusal. batch-object-registration.ts already has JudgingRegistry with the same signature, so one shared type would keep the two in step.
  • N4: e61155be handles the stale sentence in 18.record-currency-follow-pair-refused-on-install-and-reload.ts:46-47 by superseding it from the new entry, and leaves the registered entry unedited. That is acceptable. The seat decides whether to amend the registered entry instead.

Implemented-by: claude/area-E2b-33593
Reviewed-by: session_016WV4d1PGptBW3QRQNmy5e6

VERDICT: FAIL

The before/after comparison keyed on the refusal message, which lists the
parent's code fields, so a parent upgrade that only added one was refused
over a pair it left as it found it. Pins that case, the extension package's
own no-change upgrade, and the roll-up door a published object_extension
save now meets.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
…nd scope R7 to runs

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382
Request: delta review · area E2b · head f1f49b3 · Fixes #33593 (after FAIL 6888559585 on fb22e7b)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head f1f49b3 · 2026-11-15T03:57Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f1f49b3514dee2f5365c621673e4208ad81d0421
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.record-currency-follow-extension-judged-as-served.ts + .changeset/33593-extension-follow-judged-as-served.md, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/registry-question.ts, packages/objectql/src/record-currency-aggregate-door.ts, packages/objectql/src/registry.ts, packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts, packages/objectql/src/protocol-batch-object-registration.test.ts

Delta review after the FAIL at fb22e7bd (comment 6888559585), against the area's request (comment 6888771065). Read: the two new commits 89d28000 and f1f49b35 (git diff fb22e7bd f1f49b35, 6 files, +72/−19), the full PR diff where a finding needed it, the PR body at this head, and main's door at c32bb6cc for FROM readings. The head has not moved past f1f49b35. Line numbers are at f1f49b35. I ran no test, build or gate. Every behaviour below is by reading.

① Derived judgments

Round-1 must-fixes.

  • M1 (round 1) — closed in the code and the pin; the declaration is short by one arm (see new M1 below). The protocol-save.ts hunk (:1257-1273) is unchanged and still asks D6's roll-up door through objectRegistrationRefusal(..., 'extend', { againstRegistry: true }) (registry.ts:5820). It is now declared in the changeset (:26), the PR table, the entry's surface, and registry-question.ts:16-18. The pin protocol-batch-object-registration.test.ts:528 saves an object_extension adding sum(ledger_own_line.amount) over an own-currency amount and asserts 422 INVALID_METADATA, no registered field and no active row. I checked the emitter: RecordCurrencySummaryRefusedError carries code = RECORD_CURRENCY_SUMMARY_REFUSED_CODE = 'INVALID_METADATA' and status = 422 (record-currency-aggregate-door.ts:224, :232-235), so the sentence's code is right. Without the hunk the save stores the row and that pin goes red.
  • M2 (round 1) — the sentence is no longer compared, but the pair key leaves out the parent the pair points at (see new M2 below). recordCurrencyFollowRefusal now compares followPairKey(kind, object, field, target) (record-currency-aggregate-door.ts:536-557). The round-1 example (a parent upgrade that only adds cc) is pinned (manifest-service-artifact-refusal-restores.test.ts:950): the old message key would refuse it, the new key installs it.
  • M3 (round 1) — closed. manifest-service-artifact-refusal-restores.test.ts:941 boots with the bad extension, upgrades extender unchanged to 1.0.1, and asserts it installs and still serves invoice.title. By reading, dropping the extend arm's replaced capture makes before the empty slot, which holds no ext_amount, so this pin goes red. That matches the area's ablation claim.
  • M4 (round 1) — closed. The changeset now scopes the R7 line to runs (:24, matching seat 5's ruling A) and adds the unchanged-extension re-publish line for single save and the batch writer (:25). The entry's reason says the same.

must-fix M1: the D6 line describes only one of the two roll-ups D6 refuses, and the entry leaves out the other direction.

  • What D6 refuses. recordCurrencySummaryRefusal refuses sum / avg / min / max of any child amount recordCurrencyAggregandOf returns a code for, which is every currencyMode: 'record' amount. rollupVerdict (record-currency-aggregate-door.ts:334-350) admits only one shape: the amount follows that very parent's code through the very master_detail the roll-up reads. So it also refuses a roll-up of a following amount that is read on another parent, or through another relation (the follows arm of the error, :259-270).
  • What the texts say. The changeset (:26), the PR table's last row, and the entry's surface all say "a child amount whose rows carry their own currency". That covers the own-code arm only. An object_extension single save that adds a sum of a following amount through the wrong relation also moves FROM stored 200 (registration warned) TO refused 422, and nothing declares it.
  • The entry is shorter still. The changeset also lists "an amount a registered parent's such roll-up reads" (D6's second loop, :379-398). The entry's surface names only the roll-up the extension adds.
  • Fix (text only, no new pin needed, since the existing pin proves the door is asked): in the changeset :26, the PR table row and the entry's surface, say "a child amount declared currencyMode: 'record' (in each row's own currency, or following a parent's code but not read on that parent through the master_detail it follows)". Add D6's second direction to the entry's surface.

must-fix M2: the R7 pair key does not include the object the amount follows, so a run that re-points the pair onto another bad parent is admitted, and that answer moves undeclared.

  • The key. For a following amount the key is follow + object + field + pointer (record-currency-aggregate-door.ts:593, :612). The pointer is the string MASTER_DETAIL.CODE. The object it reaches is path.master, the master_detail's reference (recordCurrencyPathOf, packages/objectql/src/validation/record-currency-code.ts:145-156). That object is not in the key.
  • Example. A cold boot admits suite_line.amount following invoice.title, and invoice references suite_invoice, which has no code in title. Billing then upgrades suite_line and changes only invoice.reference to suite_other, which also has no code in title. The served reading refuses follow/suite_line/amount/invoice.title. The before reading (the replaced layer, registry.ts:5866-5904) refuses the same key. The upgrade installs.
  • On main (c32bb6cc, recordCurrencyFollowRefusal with no before) the same upgrade is refused 422. So the answer moves FROM refused TO installed.
  • The texts claim otherwise. The changeset (:24) lists only "a no-change upgrade … or an upgrade that only adds an unrelated code field". The entry says such a run "is now refused only when it changes the pair (the pair is compared, not the refusal sentence)". This run makes a new bad pair and is not refused. It is the R6 case (blame the change) from the other end.
  • The same gap holds for an extension's own new master_detail (the third BAD_EXTENSIONS shape, inv2.title): an extension upgrade that re-points inv2 onto another bad parent installs.
  • Fix. Add the followed object to the follow key: path.master in the own loop (:593), and name in the other-ends loop (:612, where path.master === name). Pin the example above (refused 422, Billing stays at the old version). Round 1 suggested "the followed pointer" for this key. That suggestion was incomplete, and this finding corrects it.

Nothing else in the delta breaks R1–R7.

  • The rollup key (:577, :626) names the child object and field in full, so it has no such gap.
  • A pair refused before for one reason and after for another (for example "no field title" and then "title holds no code") keeps its key and is not refused. That is the run leaving a refused pair refused, which R7 allows.
  • R6 is unchanged: a de-code or a removal makes a key the before reading does not hold, so it is refused, and its two pins (:900, :914) still assert the package-naming sentence.

② Semver level

  • minor ×3 is still correct. The delta adds no package. The title carries !. Both declaration lines (Clause-②: yes (narrowing), Metadata-protocol: narrowed) agree in the PR body and the changeset. The changeset still carries exactly one ADR-0087 marker (registered record-currency-follow-extension-judged-as-served). Lint & Repo Gates is green at this head.
  • The FROM/TO list needs the two fixes named in M1 and M2.

③ Boundary flags

  • Not Tier H, and not governed. The file list is the same 8 files. None is a GOVERNED_SURFACES row. Governed Surface Queue Guard is green at this head.
  • Seat 5's R7 ruling (A, runs only) is applied in the changeset, the entry and the PR body. No new seat ruling is needed for M1 or M2: both are the code and the text disagreeing.
  • Split-out (pre-existing, not this PR's to fix): D6 judges an extend body bare (re-keyed, registry.ts:5820), not as served. In its second loop, an extension's following amount that a registered parent rolls up through the child's own master_detail is refused, because the extension body does not hold that master_detail, so path.master is undefined (rollupVerdict, :346). Run-time registration and the batch writer already refused this. This PR moves the single save from stored-then-warned to 422, which is more honest. I recommend the seat file a card.
  • CI at this head (68 check-runs read): no failure. Lint & Repo Gates, Type Check · source gates / consumer gates / debt ledger, Build Core, Dogfood Regression Gate and Governed Surface Queue Guard are green. Test Core (1-8/8), Test UI (1-16/16), Type Check · workspace and Type Check UI were still running when I read them. CI is not part of this verdict.

④ Design judgment

The design is still right, and the delta is the right shape. Keying on the pair and not the sentence is the correct fix for round-1 M2, and returning the key from the same generator that builds the refusal keeps the two readings from drifting. The only fault is one missing field in that key (M2).

should-fix S1: the BREAKING paragraph and the remedies still describe only the follow door. The changeset's BREAKING paragraph (:14) names only authors of a record-mode amount. Its "The fix" sentence (:16) and the entry's replacement name only follow-door remedies. A D6-refused object_extension save is now a breaking answer for a roll-up author too. Add that author to the paragraph, and add D6's remedy (use function: 'count', roll up through the master_detail the amount follows, or roll up a stored home-currency amount) to the fix sentence and to replacement. The refusal's own text already carries that remedy.

Nits:

  • N1: the PR body's acceptance note on registry-question.ts still quotes the old sentence ("asks the follow door too"). At this head the file says it asks both record-currency doors.
  • N2: changeset :18 says the first three lines hold at all three askers and "the others name their askers". The fourth line (R6) names none, but it holds at all three too. Say "the first four".
  • N3: changeset :25 says "FROM saved (200 …)" for the batch writer as well. The batch writer answers in its own per-row result, not with 200. Say "saved" for the batch writer and keep "200" for single save.
  • Carried from round 1, not addressed (still nits): N1 (the body's priority is dropped at protocol-save.ts:1269 and batch-object-registration.ts:167), N2 (no pin for the overlay arm's replaced capture), N3 (the inline objectRegistrationRefusal type in protocol-save.ts:1263 duplicates JudgingRegistry).

Implemented-by: claude/area-E2b-33593
Reviewed-by: session_016WV4czb1FQB8j27FVgnMye

VERDICT: FAIL

R7 compared a run's follow refusals by (kind, object, field, pointer), so
an upgrade that only re-pointed the pair's master_detail onto another parent
lacking the code kept the key and installed where main refused it. The key
now carries the followed object; two pins hold the own-body and the
extension re-point refused 422.

The changeset, the semantic entry and the registry-question header now
declare both directions of D6's roll-up door on an object_extension single
save, the following-amount arm of D6, and D6's remedies for roll-up authors.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czrwT7WKAde95kC4cg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4czrwT7WKAde95kC4cg
Request: delta review · area E2b · head c298995 · Fixes #33593 (after delta FAIL 6888891782 on f1f49b3)

  • M1 (text): changeset D6 line, PR table last row and the entry's surface now say "a child amount declared currencyMode: 'record' (in each row's own currency, or following a parent's code but not read on that parent through the master_detail it follows)" and name D6's second direction (a registered parent's roll-up over an amount the extension adds); registry-question.ts header says both directions. Pin: existing protocol-batch-object-registration.test.ts:528 (door asked).
  • M2 (code + pin): the follow pair key now carries the object the pointer's master_detail reaches (record-currency-aggregate-door.ts:596 own loop, :615 other-ends loop). Pins: manifest-service-artifact-refusal-restores.test.ts:601 (child upgrade re-points invoice from suite_invoice to suite_other, refused 422, Billing stays 1.0.0) and :982 (extension re-points its own inv2, refused 422). Ablation of the own-loop key to the bare pointer: exactly those 2 red, restored to HEAD.
  • M2 text: changeset R7 line and the entry's reason name the key fields and say a re-point onto another bad parent is still refused.
  • S1: BREAKING paragraph names the roll-up author; the fix sentence and the entry's replacement carry D6's remedies (relationshipField through the followed master_detail, function 'count', or a stored home-currency amount).
  • Nits fixed: N1 (body quote of registry-question.ts), N2 ("the first four lines"), N3 (single save 200; batch writer "saved" in its own result). Round-1 nits N1-N3 left.
  • Readings at c298995: objectql typecheck + full suite 595/595 files, 13101 tests, VERDICT 0; touched files 67/67; spec migrations tests 187/187; check:adr-0087-registration, check:spec-changes, check:upgrade-guide, check:nul-bytes, eslint (4 files) exit 0.
  • Not run this round: dogfood battery, dependents (ordered after PASS).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head c298995 · 2026-11-15T04:57Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c29899531b0b5af7e168a876356ee8422baa815d
Local-runs: none
Scope: packages/objectql/src/record-currency-aggregate-door.ts, packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts, packages/metadata-protocol/src/registry-question.ts, packages/spec/src/migrations/entries/semantic/18.record-currency-follow-extension-judged-as-served.ts + .changeset/33593-extension-follow-judged-as-served.md

Delta review after the FAIL at f1f49b35 (comment 6888891782), against the area's request (comment 6889428441). Read: the one new commit c2989953 (git diff f1f49b35 c2989953, 5 files, +65/−16), the PR body at this head, the door at this head, and main's door at c32bb6cc for FROM readings. The head has not moved past c2989953. Line numbers are at c2989953. I ran no test, build or gate. Every behaviour below is by reading.

① Derived judgments

Round-2 findings.

  • M1 (round 2) — closed. The changeset's D6 line (:25), the PR table's last row and the entry's surface (:12-24) now name both arms D6 refuses: an amount "in each row's own currency, or following a parent's code but not read on that parent through the master_detail it follows". That matches rollupVerdict (record-currency-aggregate-door.ts:334-350), which admits only path.master === parent && relation === path.via. All three texts also name D6's second direction (a registered parent's roll-up over an amount the extension adds, recordCurrencySummaryRefusal's second loop, :379-398), and so does the registry-question.ts header (:16-19). The code and the emitter are unchanged. RecordCurrencySummaryRefusedError still carries INVALID_METADATA / 422 (:224, :233-236), so the stated code is right. The existing pin (protocol-batch-object-registration.test.ts:528) still proves the door is asked.
  • M2 (round 2) — closed in the code and the pins; one moved answer is now declared wrongly (see new M1 below). Every emitter of a follow key changed. There are four followPairKey calls (:580, :596, :615, :629). The two follow ones now carry the object reached: ${path.master}.${pointer} in the own loop (:596) and ${name}.${pointer} in the other-ends loop (:615), where path.master === name, so the two spellings agree. The two rollup keys already named the child object and field and are unchanged. Both readings of recordCurrencyFollowRefusal (:536-548) go through the same generator, so they cannot drift.
    • Do the pins fail without the key change? Yes, by reading. Pin manifest-service-artifact-refusal-restores.test.ts:601: the before reading (the child layer the run replaced, invoice → suite_invoice) refuses follow/suite_line/amount/invoice.title. Under the bare-pointer key the served reading (invoice → suite_other) yields the same key, so 1.1.0 installs and the pin goes red. Pin :982 is the same with the extension's own inv2. The helpers it uses (object, invoice, line, billing, extender, follows, FOLLOW_REFUSED, fieldOf) are in scope at both lines. This matches the area's ablation (exactly these 2 red).
    • The other-ends change (:615) changes no behaviour. In that loop path.master === name always, and both readings are taken for the same name, so adding name cannot split a key. It keeps the two spellings the same, which is right, and needs no pin.
    • R7 still holds. A no-change upgrade of the parent's owner (other-ends loop, same name), of the child's owner, or of the extension package (own loop, same path.master) makes the same key in both readings. The existing R7 pins hold this, and the area reports them green at this head.
  • S1 (round 2) — closed. The BREAKING paragraph (:14) now names the roll-up author and points to the last line. The fix sentence (:16) and the entry's replacement (:25-35) carry D6's three remedies (roll up through the followed master_detail with summaryOperations.relationshipField, function: 'count', or a stored home-currency amount). Those are the remedies the refusal's own text gives (:267-274).
  • Round-2 nits — fixed. N1: the body quotes the new registry-question.ts sentence. N2: "The first four lines" (:18). N3: "single save answered 200, the batch writer saved the row in its own result" (:24).

must-fix M1: the re-point line says "as before" for the extension package's upgrade, but main installed that upgrade. The answer moves FROM installed TO refused, and the texts declare it unchanged.

  • On main (c32bb6cc) the door judges an extend layer with partial: true (registry.ts:5807). It asks only the layer's own roll-ups and returns before the following half (record-currency-aggregate-door.ts:543, if (view.partial) return undefined;), and before the other-ends half. So an extension package's upgrade that re-points its own inv2 from suite_invoice to suite_other (neither holding a code in title) is never asked about the pair, and it installs. At f1f49b35 it installed too (the bare-pointer key).
  • At this head the same upgrade is refused 422. That is the new pin :982, and it is right.
  • What the texts say. The changeset (:24): "An upgrade that re-points the master_detail onto another parent lacking the code makes a new pair and is still refused 422, as before." The PR table row "upgrade (child's owner or extension package) that only re-points …": "refused 422 → refused 422 (unchanged; …)". Both are true for the child's owner (on main the child's own body met the following half and was refused) and false for the extension package.
  • Why it matters. This is a moved answer in the narrowing direction, and the Clause-② list declares it unchanged. It is not covered by the first FROM/TO line either: that line is about "an extension-only package adding an amount", not an upgrade of one that already serves it. The entry's reason (:47-49) does not say "as before", so it is not wrong.
  • Fix (text only; pin :982 already holds the TO): split the PR table row: the child's owner stays "refused 422 → refused 422 (unchanged)"; the extension package becomes "installed (main never asked an extension layer's following half) → refused 422". In the changeset :24, scope "as before" to the child's owner, and say the same upgrade of an extension package moves FROM installed TO refused 422. The pin's title already treats it as a moved answer (it is not labelled CONTROL, unlike :601).

Nothing else in the delta breaks R1–R7. The delta changes no other code. The rollup pairs and R6 are as at f1f49b35.

② Semver level

  • minor ×3 is still correct. The delta adds no package. The title carries !. Clause-②: yes (narrowing) and Metadata-protocol: narrowed agree in the PR body and the changeset. The changeset still carries exactly one ADR-0087 marker (registered record-currency-follow-extension-judged-as-served). Lint & Repo Gates is green at this head.
  • The FROM/TO list needs the fix named in M1.

③ Boundary flags

  • Not Tier H, and not governed. The delta touches 5 of the same 8 files. None is a GOVERNED_SURFACES row. Governed Surface Queue Guard is green at this head.
  • Seat 5's R7 ruling (A, runs only) is applied and the delta keeps it. No seat ruling is needed for M1: the code and the pin are right, and only the text disagrees with them.
  • The split-out from round 2 still stands (D6 judges an extend body bare, not as served; pre-existing). I recommend the seat file a card if it has not.
  • CI at this head (71 check-runs read): 58 success, 13 skipped, no failure, none pending. Lint & Repo Gates, TypeScript Type Check, Type Check · workspace / source gates / consumer gates / debt ledger, Type Check UI, Build Core, Dogfood Regression Gate and Governed Surface Queue Guard are green. CI is not part of this verdict.

④ Design judgment

The design is right, and the delta is the right fix. Naming the object the master_detail reaches in the pair's key closes the re-point gap at its source. Both loops spell the key the same way, so a pair has one identity whichever end finds it. The only fault is the declaration of the extension-package arm (M1).

Nits:

  • N1 (new): the changeset's R7 parenthetical (:24, "the object and field declaring it, the pointer, and the object the pointer's master_detail reaches") lists only a following amount's key. R7 also compares roll-up pairs, which are keyed by the child object and field (the PR body's R7 bullet says so). Say "for a following amount" or add the roll-up key.
  • Carried from round 1, not addressed (still nits): N1 (the body's priority is dropped at protocol-save.ts:1269 and batch-object-registration.ts:167), N2 (no pin for the overlay arm's replaced capture), N3 (the inline objectRegistrationRefusal type in protocol-save.ts:1263 duplicates JudgingRegistry).

Implemented-by: claude/area-E2b-33593
Reviewed-by: session_016WV4czb1FQB8j27FVgnMye

VERDICT: FAIL

…ion re-point moves FROM installed

The re-point upgrade of an extension package's own master_detail was
installed on main (an extension layer's following half was never asked)
and is now refused 422; the line said "as before" for both owners. The
R7 parenthetical now names the roll-up pair key as well as the following
amount's key.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czrwT7WKAde95kC4cg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4czrwT7WKAde95kC4cg
Request: delta review · area E2b · head 31e745a · Fixes #33593 (after delta FAIL 6889470504 on c298995; text only)

Delta review request, PR #33621, review#3 delta-2 FAIL (comment 6889470504). Head c298995 -> 31e745a (one commit, 1 file: the changeset; no code).

  • M1 (text): changeset re-point sentence scopes "as before" to the child's owner; the same re-point upgrade of an extension package moves FROM installed (main never asked an extension layer's following half) TO refused 422. PR table row split in two; the R7 bullet says the same. Pin: existing manifest-service-artifact-refusal-restores.test.ts:982.
  • N1: changeset R7 parenthetical now gives the key "for a following amount" and "for a roll-up" (declaring object and field, and the child object and field it reads), matching followPairKey at record-currency-aggregate-door.ts:580,:629.
  • Gates at 31e745a: check:adr-0087-registration, check:spec-changes, check:upgrade-guide, check:empty-changeset, check:changeset-fixed, check:nul-bytes, check-changeset-no-major: exit 0. No tests run (text only).
  • Not changed: the ledger entry's reason carries the same following-only key parenthetical (not named by the verdict; left). Round-1 nits N1-N3 left.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head 31e745a · 2026-11-15T05:05Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 31e745afc8acef92a0ca4ea9dab845acb4a143a2
Local-runs: none
Scope: packages/objectql/src/record-currency-aggregate-door.ts, packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts, packages/metadata-protocol/src/registry-question.ts, packages/spec/src/migrations/entries/semantic/18.record-currency-follow-extension-judged-as-served.ts + .changeset/33593-extension-follow-judged-as-served.md

Delta review after the FAIL at c2989953 (comment 6889470504), against the area's request (comment 6889514419). Read: the one new commit 31e745af (git diff c2989953 31e745af), the PR body at this head, the door and the test file at this head. The head has not moved past 31e745af. Line numbers are at 31e745af. I ran no test, build or gate. Every behaviour below is by reading.

① Derived judgments

The delta is text only. git diff c2989953..31e745af --stat: one file, .changeset/33593-extension-follow-judged-as-served.md, +1/−1 (line :24). The door, the test file, registry-question.ts, the migration entry and every other file are byte-identical to c2989953, which round 3 accepted. The PR body moved too (read below).

M1 (round 3) — closed.

  • Changeset :24. "as before" is now scoped: "An upgrade of the child's owner that re-points the master_detail onto another parent lacking the code makes a new pair and is still refused 422, as before." That is right: on main the child's own body met the following half and was refused. The next sentence declares the extension arm as a moved answer: "The same re-point upgrade of an extension package (its own master_detail, pointer string unchanged) moves FROM installed (main never asked an extension layer's following half) TO refused 422." That matches main's door (if (view.partial) return undefined; before the following half, the reading in 6889470504).
  • The TO is pinned. manifest-service-artifact-refusal-restores.test.ts:982 boots the extender with inv2 → suite_invoice and ext_amount: follows('inv2.title'), then registers 1.0.1 with inv2 → suite_other. It expects FOLLOW_REFUSED (:358: code: 'INVALID_METADATA', status: 422, httpStatus: 422) on suite_line.ext_amount, the extender left at 1.0.0 and inv2 still on suite_invoice. Same pointer string, other parent: this is exactly the declared case. The pin's title is not labelled CONTROL, which agrees with "moved answer".
  • PR body table. The old row is split in two. "upgrade of the child's owner … pointer string unchanged": "refused 422 → refused 422 (unchanged; the pair key names the followed object)". "upgrade of an extension package that only re-points its own master_detail …": "installed (main never asked an extension layer's following half) → refused 422". Both are right, and both say n/a for single save and the batch writer, which is right: a re-point upgrade is a run. The R7 bullet (body :31) and the Moved-pins paragraph (:67, citing :982 as "not a CONTROL") say the same. The body is re-signed (signed: domain:server#5).

N1 (round 3) — fixed. The R7 parenthetical (:24) now gives both keys: "for a following amount, the object and field declaring it, the pointer, and the object the pointer's master_detail reaches; for a roll-up, the object and field declaring it and the child object and field it reads". That matches followPairKey (record-currency-aggregate-door.ts:558) at all four calls: follow keys carry ${path.master}.${pointer} (:596) or ${name}.${pointer} (:615); rollup keys carry ${rollup.child}.${rollup.childField} (:580) or ${name}.${rollup.childField} (:629), where name is the child. The PR body's R7 bullet says the same.

Nothing else moved. R1–R7 stand as judged at c2989953.

② Semver level

  • minor ×3 is still correct. No package added. The title carries !. Clause-②: yes (narrowing) and Metadata-protocol: narrowed agree in the PR body and the changeset. The changeset still carries exactly one ADR-0087 marker. The FROM/TO list is now complete for the re-point arm.

③ Boundary flags

  • Not Tier H, and not governed. The delta touches one changeset, not a GOVERNED_SURFACES row.
  • The split-out from round 2 still stands (D6 judges an extend body bare, not as served; pre-existing). I recommend the seat file a card if it has not.
  • CI at this head: no check-runs registered yet when read (0 check-runs, combined status pending; the head was pushed about three minutes before). CI is not part of this verdict.

④ Design judgment

The design is right, and the declaration now matches the code. Keying a pair by the object its master_detail reaches closes the re-point gap at its source, and the texts now declare the one answer that moves because of it.

Nits (carried from round 1, not addressed, do not block): N1 (the body's priority is dropped at protocol-save.ts:1269 and batch-object-registration.ts:167), N2 (no pin for the overlay arm's replaced capture), N3 (the inline objectRegistrationRefusal type in protocol-save.ts:1263 duplicates JudgingRegistry).

Implemented-by: claude/area-E2b-33593
Reviewed-by: session_016WV4czb1FQB8j27FVgnMye

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4czrwT7WKAde95kC4cg
Request: delta review · area E2b · head bd84468 · Fixes #33593 (after PASS 6889538233 on 31e745a; merge of main, comment-only resolution)

Merge: origin/main 53f5a4c merged into claude/area-E2b-33593 as merge commit bd84468 (no rebase, no force); pushed. Done via scripts/pm/os-regen-merge.sh (base recorded, step 1 stopped on the conflict, rerun after commit: step 2 took main's side of no path, step 3 nothing left to commit).
One conflict, comment only: packages/metadata-protocol/src/registry-question.ts header. Kept main's (#33590) follow-door asker list (single save or publish, batch writer, registration run at its end) and the PR's object_extension sentence for the single-save faces.
Main's closing line "An extend layer is asked only of its own roll-ups (the door's partial rule), by whichever asker registers it." was false after this PR. It now reads: "An extend layer is judged like any other layer, by whichever asker registers it: as its object will be served, with every enabled extension and the layer in its slot, in both directions — the amounts and roll-ups the layer adds against their other ends, and the registered amounts and roll-ups whose other end is that object."
packages/objectql/src/registry.ts auto-merged with no overlap: main's hunks (#33708, #33517) do not touch the follow door. No other stale partial-rule text is left (git grep for view.partial, extensionFieldsOf, "only its own roll-ups" finds nothing).
Regen: the merged tree differs from origin/main in only the PR's 8 files, and none of them is a generated path. After a closure build, spec check:generated was green 14/14 and check:platform-object-tenancy-census was green. Nothing regenerated, no regen commit.
Tests at bd84468: the objectql touched files plus registry.test and record-currency-guards (4 files, 235 tests), all of metadata-protocol (349 files, 22883 passed), and the 13 remaining dependents, all with 0 failures. Gates: adr-0087-registration, spec-changes, eslint on the 7 touched .ts files, nul-bytes, all exit 0.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review (carry)

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bd8446859c576a36cea1108cf1877f54296b8758
Local-runs: none
Scope: packages/objectql/src/record-currency-aggregate-door.ts, packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts, packages/metadata-protocol/src/registry-question.ts, packages/spec/src/migrations/entries/semantic/18.record-currency-follow-extension-judged-as-served.ts + .changeset/33593-extension-follow-judged-as-served.md

Carry of the PASS at 31e745af (comment 6889538233) to the merge of main at bd844685, on the area's request (comment 6892596848). I ran no test, build or gate. Every reading below is from git and the check-runs API.

① What changed

The PR's own diff is unchanged except one header comment. Per file, the +/- lines of git diff 605d7121 31e745af (old merge base) and git diff 53f5a4c9 bd844685 (new base) are identical for 7 of the 8 files: the door, registry.ts, protocol-save.ts, both test files, the migration entry and the changeset. The one that differs is registry-question.ts, in its header comment only. That is where the merge conflict was resolved.

The rewritten line is accurate. #33590's asker list is kept. Its line "An extend layer is asked only of its own roll-ups (the door's partial rule)" is false after this PR. It now says an extend layer is judged "as its object will be served, with every enabled extension and the layer in its slot, in both directions". That matches the door at this head: recordCurrencyFollowRefusal(served, view, before) judges served (base, enabled extensions, the layer in its slot). It weighs the object's own roll-ups and following amounts against their other ends, and the registered amounts and roll-ups whose other end is that object (followRefusalsOf). The partial early return is gone, and so are extensionFieldsOf and parentFieldsAt. git grep finds no view.partial, extensionFieldsOf or parentFieldsAt left at this head.

Main does not touch the follow door or R1–R7. Since the old base, main changed two of the PR's files. In registry.ts it changed the managed-api-method warning (#33517) and the package-less action overlay binding (#33708). Neither is near followPairKey or the follow door's call (registry.ts:5890). followPairKey has only its four calls in the door, and recordCurrencyFollowRefusal has only its one caller in registry.ts. The object_extension door fold (#33702) is in the lint authoring gate, and the analytics remedy (#33615) is in the cube door. Neither one judges registration.

No regeneration is owed. None of the PR's 8 paths is generated. Semantic migration entries have no generated index: the new entry is referenced only by itself and the changeset.

② Semver level

Unchanged: minor ×3. Clause-②: yes (narrowing) stands.

③ Boundary flags

Unchanged. CI at this head: 67 check-runs, 56 success, 11 skipped, 0 failing or pending.

④ Design judgment

Unchanged from 6889538233: the design is right, and the declaration matches the code. The merge only made the header comment match it as well. The nits N1–N3 are carried. They do not block.

Implemented-by: claude/area-E2b-33593
Reviewed-by: session_016WV4czb1FQB8j27FVgnMye

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4czrwT7WKAde95kC4cg
ACCEPT · area E2b (area-lease pilot #33059) · 2026-11-15T09:55Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 09:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 06e53a7 Nov 15, 2026
68 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-E2b-33593 branch November 15, 2026 10:23
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ly on its owner key (objectstack-ai#33708)

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:注册表判断「无包的 action 是哪个包 action 的定制」时,只认归属对象(owner
key)相同的那个包;在别的对象上的无包 action 是环境自己的条目。
- 为什么改:action 的身份是(包、归属对象、名称),执行 action
必须解析到其本包在该对象上声明的那条,权限与参数检查跑在这条声明上。
- 风险与回滚:只动 `action` 类型的一处绑定判断,其它元数据类型照旧(有对照测试);回滚即 revert 本 PR。
- 先看:`packages/objectql/src/registry.ts`(`overlaySlotBinding` 无包分支与新函数
`actionHoldersOnOwnerKeyOf`)、`packages/objectql/src/action-package-addressing.test.ts`、`packages/runtime/src/action-package-addressing.test.ts`。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
src/action-package-addressing.test.ts`,预期 28 个测试全绿。
- 需要你做的:无,席位落地。

## What changes

Rule: executing an action resolves the action its own package declared
on its owner key, never a same-named action of another object or
package, and the permission and parameter checks run on that resolved
declaration.

An action is identified by `(package, owning object, name)` (ADR-0150
D4). The registry's package-scoped reads (`getPackageScopedItem`,
`getEnvironmentScopedItem`, and through them `resolveActionByPackage`)
now apply that identity to a package-less action:

- on the owner key of exactly one package's action of the name: that
package's customization, as before;
- on another object, or object-less beside an action bound to an object:
the environment's own item;
- on the owner key of two or more packages' actions: no package's item
and no environment item, as before.

`packages/objectql/src/registry.ts`: `overlaySlotBinding` counts, for
`action`, only the holders whose own item has the package-less action's
owner key (`actionHoldersOnOwnerKeyOf`, keyed by
`standaloneActionOwnerKey`, every object-less spelling one key). Every
other type keeps the one-holder reading.

Effect at the route: a caller of a package, or of a package depending on
it, resolves that package's own declaration on its object under that
package's coordinate; a package caller on the object of a package-less
action is refused naming the environment (ADR-0150 D3), never answered
as another package's. A route that names no package answers as before.

Not changed here: the exact `?package=` read and the declaration read of
a route that names no package. Both already answer each route's own
declaration in every composition these pins exercise (the controls
below).

## Tests

- `packages/objectql/src/action-package-addressing.test.ts`, new
top-level describe "a package-less action customizes only the holder
whose action has its owner key": 8 cases (6 pins, 2 controls): one
holder on another object in both registration orders, the holder's
caller and its dependent's caller, the package-less action's own object
for a caller with no package and for a package caller, object-less
beside bound, two holders on two objects (third object, and one holder's
object), a bound holder beside an object-less one. Controls: the one
holder's own owner key (bound and object-less), two holders on one owner
key, and another type (`mapping`) keeping the one-holder reading.
- `packages/runtime/src/action-package-addressing.test.ts`, new
top-level describe "the action route resolves the declaration its own
package declared on its owner key": the environment's and the platform's
package-less action, each in both registration orders, through
`resolveRouteActionDeclaration` and `executeRegisteredAction`: 8 pins, 5
controls (the no-package route on both objects keeps each declaration
and its `requiredPermissions`; a package-less action on the package's
own object stays its customization).

## Acceptance notes

- Ablation (one, on the binding): the owner-key test replaced by the old
one-holder count through `scripts/ablation-replace.mjs` (anchor 1 to 0,
blob changed), `@objectstack/objectql` rebuilt, the marker absent from
`dist/` (0 hits in `index.js` and `index.mjs`). Red: objectql 6 failed /
22 passed (28), every pin red, every control green; runtime 8 failed / 5
passed (13 selected), every pin red, every control green. Restored: blob
equal to HEAD (`8728bd488ed3`), `git diff HEAD` empty, rebuilt,
`ablation-dist-preflight` marker present in 4 built files; objectql
28/28, runtime 136/136. The mutant build's DTS step failed on the
then-unused helper (TS6133) after the JS bundles were written; the JS
bundles carried the mutant, which is what the runtime suite loads.
- Overlap: open PR objectstack-ai#33621 edits `packages/objectql/src/registry.ts` in
the object-extension follow area; no hunk shared with this diff.

## Verification

All readings on head `cee768517a` unless named.

<details><summary>Package suites</summary>

```text
@objectstack/objectql test (cee7685)       Test Files 596 passed (596) · Tests 13110 passed (13110)
@objectstack/runtime action-package-addressing (cee7685)   Tests 136 passed (136)
@objectstack/metadata-protocol test (fix commit, before the merge)   Test Files 340 passed | 9 skipped (349) · Tests 22881 passed | 43 skipped
@objectstack/runtime test (fix commit, before the merge)   Test Files 603 passed (603) · Tests 10842 passed | 19 skipped
objectql + runtime typecheck (cee7685)   tsc --noEmit clean · check:test-typecheck OK for both
```

</details>

<details><summary>Derived gate families (dispatch-gates --commands,
reconciled with --ran)</summary>

```text
head cee7685 · 72 derived, 71 exit 0, 1 NOT MEASURED
NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (reads every package's dist/; this tree built the runtime closure only); CI's Lint & Repo Gates run measures it
dispatch-gates --ran: 72 derived famil(ies) accounted for, 71 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)

exit 0  node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0  node scripts/check-adr-0087-registration.mjs --self-test
exit 0  node scripts/check-changeset-no-major.mjs --base origin/main
exit 0  node scripts/check-closing-keyword-parity.mjs
exit 0  node scripts/check-closing-keyword-parity.mjs --self-test
exit 0  node scripts/check-comment-mask-adoption.mjs
exit 0  node scripts/check-comment-mask-adoption.mjs --self-test
exit 0  node scripts/check-comment-mask-corpus.mjs
exit 0  node scripts/check-dts-emitted.mjs --self-test
exit 0  node scripts/check-empty-changeset.mjs --base origin/main
exit 0  node scripts/check-empty-changeset.mjs --self-test
exit 0  node scripts/check-engine-split-ratio.mjs --self-test
exit 0  node scripts/check-issue-citations.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs --self-test
exit 0  node scripts/ci/assert-turbo-remote-cache.mjs --self-test
exit 0  node scripts/ci/plan-test-core-shards.mjs --self-test
exit 0  node scripts/ci/prune-turbo-cache.mjs --self-test
exit 0  node scripts/ci/snapshot-next.mjs --self-test
exit 0  node scripts/docs-audit/check-affected-docs.mjs
exit 0  node scripts/docs-audit/check-drift-comment.mjs
exit 0  node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0  node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0  node scripts/release-pending-publish.mjs --self-test
exit 0  pnpm --filter @objectstack/spec run check:duration-unit-keys
exit 0  pnpm --filter @objectstack/spec run check:error-code-provenance
exit 0  pnpm check:adr-symbol-anchors
exit 0  pnpm check:changeset-gate-self-tests
exit 0  pnpm check:ci-filter-parity
exit 0  pnpm check:cli-command-ids
exit 0  pnpm check:closed-ceremony-text
exit 0  pnpm check:cross-package-test-inputs
exit 0  pnpm check:dispatcher-error-vocabulary
exit 0  pnpm check:doc-authoring
exit 0  pnpm check:driver-memory-census
exit 0  pnpm check:dts-closure
exit 3  pnpm check:dual-build-cjs-loads
exit 0  pnpm check:durability-log-level
exit 0  pnpm check:engine-double-contract
exit 0  pnpm check:error-status-conformance
exit 0  pnpm check:gitlink-declared
exit 0  pnpm check:init-service-contract
exit 0  pnpm check:issue-citations
exit 0  pnpm check:keyed-text-bounds
exit 0  pnpm check:lean-entry-closure
exit 0  pnpm check:logger-receiver-detach
exit 0  pnpm check:nul-bytes
exit 0  pnpm check:object-def-param-keys
exit 0  pnpm check:objectql-double-limit
exit 0  pnpm check:optional-error-sink
exit 0  pnpm check:org-identifier
exit 0  pnpm check:page-declaration-shape
exit 0  pnpm check:platform-object-tenancy-census
exit 0  pnpm check:published-files
exit 0  pnpm check:query-options-erasure
exit 0  pnpm check:refd-timer-probe
exit 0  pnpm check:registry-log-declared
exit 0  pnpm check:rest-log-declared
exit 0  pnpm check:rest-log-spy-declared
exit 0  pnpm check:settings-bind-window
exit 0  pnpm check:slot-lookup
exit 0  pnpm check:sourcemap-no-sources-content
exit 0  pnpm check:startup-registry-verdict
exit 0  pnpm check:system-context-census
exit 0  pnpm check:test-source-alias
exit 0  pnpm check:tier-file-adoption
exit 0  pnpm check:type-check-coverage
exit 0  pnpm check:type-check-debt
exit 0  pnpm check:undeclared-dep-imports
exit 0  pnpm check:vouch-for-reference-callers
exit 0  pnpm check:watch-hint-literal
exit 0  pnpm check:where-matcher
```

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f)_

<!-- signed: security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f
-->

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…cyMode dynamic and is drawn in the home currency (objectstack-ai#33710)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X8xbFYXNonrr3zov2yF4bkF)_

Fixes objectstack-ai#33659

Clause-②: yes (widening: a `sum`/`min`/`max`/`avg` summary over a stored
home amount is admitted with `currencyMode: 'dynamic'`)
Metadata-protocol: added
Skills-docs: follow-up objectstack-ai#33714 —
`skills/objectstack-data/rules/field-types.md` (its `homeAmount`
paragraph teaches the stored home field but not that a `summary` over it
declares `currencyMode: 'dynamic'`);
`content/docs/data-modeling/currency.mdx` and
`content/docs/data-modeling/field-types.mdx` are updated here.

## 维护者速读

- **改了什么**:子对象上的「本位币金额」字段(某个金额字段的 `homeAmount.field` 指向的那个存储字段)被父对象
`summary` 汇总时,现在可以声明 `currencyConfig: { currencyMode: 'dynamic'
}`(不写币种代码)。spec
只在汇总对象确实是本位币金额时接受它;控制台的记录页和列表单元格据此把汇总值画成组织本位币(`localization.currency`)的金额。其他
`dynamic` 汇总、`count` 汇总照旧拒绝。
- **为什么改**:ADR-0144 D6
规定合并总额读存储的本位币字段,总额算对了,但显示成裸数字(`250.00`)。之前没有一种汇总声明既被接受又诚实:`record`
只给跟随父记录币种的汇总,`dynamic` 一律被拒,`fixed` 要在元数据里写死本位币代码,而 ADR
规定元数据不写本位币。同一字段的仪表盘指标卡却显示货币符号,两处不一致。HotCRM PSA 模块需要它(hotcrm#2316)。
- **风险与回滚**:只放宽,不收紧:以前被接受的元数据全部照旧,以前被拒的只有这一种变为接受。渲染端只影响声明了 `dynamic`
的汇总字段(以前 spec 不允许存在)。回滚即 revert。单对象保存(不经 `defineStack`)只校验「指向了子字段且没写
`defaultCurrency`」,是否本位币字段只在 `defineStack` 校验,见 Acceptance notes。
-
**先看**:`packages/spec/src/stack.zod.ts`(`collectRecordCurrencyPathErrors`
新增 (d) 段与
`dynamicRollupNotHomeError`),`packages/spec/src/data/object.zod.ts`(`refuseUnadmittedSummaryCurrency`
的 `dynamic`
分支),`ui/packages/fields/src/currency.ts`(`summaryDeclaresCurrency`)。
- **两分钟验证**:`pnpm --filter @objectstack/spec exec vitest run
--maxWorkers=2 src/data/currency-summary-home-rollup.test.ts`,预期 11
个用例全绿:探针形状被接受,非本位币字段上的 `dynamic` 被拒且消息点名子对象的本位币字段。
- **需要你做的**:无。契约复审已在本 PR 通过(首轮 6890873219,增量 6891007506,`Head-sha`
4171fcd);本 PR 不触及受管路径(Tier S),按
pm-dispatch 规则由 spec 席位在 CI 全绿后落地。

## What changes

**Spec, object door**
(`packages/spec/src/data/object.zod.ts#refuseUnadmittedSummaryCurrency`).
A `dynamic` summary (written, or a `currencyConfig` with no
`currencyMode`, which parses as `dynamic`) is let through only when its
`summaryOperations` names a child object and field and it carries no
`defaultCurrency`; whether that child field is a home field needs the
child object, so the stack pass judges it. Refused here, as before: a
`dynamic` summary naming no child field (new message: "...with no
`summaryOperations` naming a child field, so it rolls up no stored home
amount..."), and a `count` in every mode. Newly worded refusal: a
`dynamic` summary with a `defaultCurrency` ("`dynamic` reads no
`defaultCurrency`, and metadata never names the home currency"); it was
refused before by the blanket `dynamic` arm. The shared `admitted`
sentence every refusal here ends with now names three cases: `fixed`,
`record`, and `dynamic` over a stored home amount.

**Spec, stack pass**
(`packages/spec/src/stack.zod.ts#collectRecordCurrencyPathErrors`, new
case (d)). A `sum` / `min` / `max` / `avg` summary declaring `dynamic`
is admitted when the child field it rolls up is named by some
`currencyConfig.homeAmount.field` on the child object
(`homeAmountSourceOf`). Any other `dynamic` roll-up is refused with
`dynamicRollupNotHomeError`, which names what the child field does
support: for a record-mode amount, its own stored home field (or
`record` on the parent when the amount follows this record); for a
`fixed` child amount, that `fixed` code; otherwise the child's home
amounts, or that it stores none. A child this stack does not declare, or
a child field it does not hold, is not judged, the same stance case (c)
takes for a `record` roll-up. A `dynamic` roll-up is judged by (d)
before (b) and (c), so it is reported once.

**Spec, text.** `FieldSchema.currencyConfig` `.describe()` and the
`CurrencyConfigSchema` docblock (`packages/spec/src/data/field.zod.ts`)
state the new admitted case;
`content/docs/references/data/{field,object}.mdx` and
`content/docs/references/system/migration.mdx` regenerated by `pnpm
gen:docs`. `packages/spec/liveness/field.json`, `field/currencyConfig`:
a dated `WIDENED 2026-11-15 (objectstack-ai#33659 ...)` line naming the reader that
now consumes `dynamic` on a summary. Verdict unchanged: LIVE.

**Console** (`@object-ui/fields`). `summaryDeclaresCurrency`
(`ui/packages/fields/src/currency.ts`) answers true for `dynamic` (and a
config with no `currencyMode`). Both roll-up faces that read it,
`SummaryField` (record page) and `FormulaCellRenderer` (`index.tsx`,
list cell), already pass the tenant currency from `useLocalization()`
and the parent row into `resolveFieldCurrency`, which answers
`localization.currency` for a non-`record` config with no `fixed` code:
the same call `ObjectMetricWidget` makes for a tile over the home field
(`resolveFieldCurrency(valueFieldDef, tenantCurrency)`). Comments in
those two faces updated; no export line in `index.tsx` touched.

**Docs.** `content/docs/data-modeling/currency.mdx`: a bullet in
"Roll-ups and datasets" and the declaration with an example under
"Totals in the home currency"; both name `defineStack` (`os validate`
and the build) as the door that refuses a `dynamic` roll-up over a
non-home field, and say a single-object save on a running server does
not judge it yet (objectstack-ai#33713). `content/docs/data-modeling/field-types.mdx`:
the `summary` "In the Console" paragraph says a roll-up declaring its
currency is drawn as money.

**Changeset:** `.changeset/33659-home-rollup-dynamic-currency.md`:
`@objectstack/spec` minor, `@object-ui/fields` patch.

### Readers measured (order step 3)

- `packages/services/service-analytics/src/plugin.ts` `sourceFieldMeta`
relays a code only for `fixed` (`defaultCurrency`) and a pointer only
for `record`; a `dynamic` summary relays neither, as the home field
itself does.
`measure-currency-coherence.ts#assertMeasureCurrenciesCoherent` judges
only those two, so a `dynamic` summary cannot trip it against the home
field it sums. No change.
- `packages/objectql/src/record-currency-aggregate-door.ts` judges
summaries over record-mode child amounts and `record` summaries only
(`summaryDeclaresRecord`); a summary over a home field (a plain
`currency` field) is admitted whatever its own `currencyConfig`. No
change, and nothing in `packages/objectql` touched (open PR objectstack-ai#33621 edits
that file).

## Tests

- New `packages/spec/src/data/currency-summary-home-rollup.test.ts` (11
cases), on the card's probe shape (`crm_probe_expense.amount`
record-mode with `homeAmount: { field: 'amount_home', rateDate:
'expense_date', rateField: 'rate_used' }`,
`crm_probe_project.home_expense_total` a `sum` over `amount_home`):
admitted by `defineStack` with `dynamic`, with `min`/`max`/`avg`, and
with `{}`; the object door alone lets it through. Refused: `dynamic`
over a plain currency field no `homeAmount` names (names
`'amount_home'`), over the record-mode amount itself (prescribes its
home field), over a child storing no home amount, over a `fixed` child
(prescribes the code); at the object, `dynamic` with no
`summaryOperations` (and its message names the third admitted case) and
`dynamic` with a `defaultCurrency`; a `count` still refused with the old
message head.
- `packages/spec/src/data/currency-config-record-mode.test.ts`: the two
cases that pinned "`dynamic` refused on every summary" now pin the
narrower refusal (no child field) at the object, and the stack's (d)
refusal with the `record` prescription for a following amount. Every
other case unchanged.
- New
`ui/packages/fields/src/__tests__/summaryFaces.homeRollup-33659.test.tsx`
(9 cases): list cell and record page draw `$250.00` under home USD and
the yuan symbol (`CN¥1,800.00`, never `$`) under home CNY; `{}` reads as
`dynamic`; no home currency gives `250.00` with no symbol; an undeclared
summary stays `250`. Acceptance 3: under USD, CNY, de-DE/EUR and
ja-JP/JPY the record page, the list cell and the metric tile's own call
over the home field (`formatCurrency(v, resolveFieldCurrency(HOME_FIELD,
tenant), locale)`) give the same text.

<details><summary>Ablations (each on committed head 7abcd20, via
scripts/ablation-replace.mjs, restored to the HEAD blob with git diff
HEAD empty)</summary>

The suites import the mutated modules from source (relative imports in
both packages), so no build sits between mutation and test.

1. Object-door admission deleted (`if (namesChild && named ===
undefined) continue;`, blob `42c0b107` → `b7aedbd9`):
`currency-summary-home-rollup.test.ts` 8 failed | 3 passed (the
admissions and every stack-pass case, which now meet the object refusal
first). Restored to `42c0b107`.
2. Stack (d) refusal removed (the
`errors.push(dynamicRollupNotHomeError(...))` line replaced by a no-op,
blob `70e8c845` → `ff1e8126`): 5 failed | 67 passed across the two spec
files (the four non-home refusals and the record-mode-file `dynamic`
case). Restored to `70e8c845`.
3. Renderer branch removed (`summaryDeclaresCurrency` without `mode ===
'dynamic'`, blob `0748515c` mutated):
`summaryFaces.homeRollup-33659.test.tsx` 8 failed | 1 passed (only the
undeclared-summary case stays green). Restored to `0748515c`.

</details>

## Acceptance notes

- **Footer** (card acceptance names it): not in this PR, at the spec
seat's word. ui seat 2 holds
`ui/packages/plugin-grid/src/useColumnSummary.ts#formatSummaryLabel` on
objectstack-ai#33542 (claim 6889088903, amendment 6889142643); that PR exports
`summaryDeclaresCurrency` from `ui/packages/fields/src/index.tsx` and
decides money in the footer by it, so a `dynamic` summary reaches the
footer once both land. Whether the footer then resolves `dynamic` to the
tenant currency with no record is the check to make after both merge
(`resolveFieldCurrency` answers the tenant default for any non-`record`
config, so it should).
- **Single-object saves.** The home-field judgement lives in
`defineStack`'s cross-reference pass. A save of one object through the
metadata API parses `ObjectSchema` (the object door), which admits a
`dynamic` summary naming any child field and no `defaultCurrency`; the
engine registry judges `record` pairs at a single-object save
(`data/record-currency-path.ts` wording) but has no `dynamic` arm. So a
`dynamic` summary over a non-home child field saved alone, outside `os
validate` / `defineStack`, is stored and drawn in the home currency.
Carrier: objectstack-ai#33713 (carrying the (d) judgement into the engine registry,
`packages/objectql`, with the `FieldSchema.currencyConfig` describe
wording, review N1). `content/docs/data-modeling/currency.mdx` names
this gap and the door that does refuse (`defineStack`: `os validate` and
the build).
- **Stored rows before the 2026-11-09 narrowing** (objectstack-ai#31958): a summary
saved then with a `dynamic` `currencyConfig` (or the old parsed `{
currencyMode: 'dynamic', defaultCurrency: 'CNY' }`) now draws as money
in the tenant currency. Not measured whether any such row exists; the
spec has refused that shape at save since objectstack-ai#31958.
- **Child not declared in the stack** (another package's object): case
(d) does not judge it, as case (c) does not; the object door's half
still holds.
- `Skills-docs:` follow-up objectstack-ai#33714 on
`skills/objectstack-data/rules/field-types.md` (`skills/**` is outside
this card's surface).

## Verification

Round 1 on head `7abcd20e` (base `origin/main` `b95d9156`). Gate log:
`/mnt/project-files/pm-orders/spec/33659-gates-ran.txt`.

Round 2 (contract review 6890873219, S1, and Lint UI job 132733878394)
on head `4171fcd6`: `currency.mdx` and the changeset's `Skills-docs:`
line (prose only), and the one `no-irregular-whitespace` error in
`summaryFaces.homeRollup-33659.test.tsx` (a literal non-breaking space
in a regex, now the `\u00a0` escape). `eslint` on the four touched ui
files: 0 errors (170 pre-existing warnings); the test file 9/9 green;
the 35 derived doc, changeset and citation families rerun on the new
tree, all exit 0 (log: `33659-gates-ran-r2.txt`). No schema or code file
changed in this round.

<details><summary>Package suites and typechecks</summary>

- `pnpm --filter @objectstack/spec test`: exit 0, Test Files 842 passed
(842), Tests 26891 passed | 1 todo.
- `pnpm --filter @objectstack/spec typecheck`: exit 0.
- `ui/packages/fields`: `pnpm run type-check` (both projects) exit 0;
`pnpm exec vitest run packages/fields/` from `ui/`: Test Files 306
passed | 1 skipped (307), Tests 4624 passed | 7 skipped.

</details>

<details><summary>Derived gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` derived 118 families
on the diff; first pass 115 exit 0, 3 exit 3 for prerequisites:
`check-plugin-teardown-shape --self-test` (pinned commit fetched),
`check:skill-examples` and `check:dual-build-cjs-loads` (dist missing).
After `turbo run build --concurrency=2` (8m13s, shared box) all three
exit 0.
- `--ran` then named one more derived family, `@objectstack/spec
check:generated`. First run exit 1: `check:test-typecheck`'s tsc died of
V8 heap exhaustion ("failed without diagnostics"), not a ratchet move;
rerun with `NODE_OPTIONS=--max-old-space-size=8192`:
`check:test-typecheck` OK (52 files / 240 errors / 131 pinned signatures
held), `check:generated` exit 0, "All 14 generated artifacts are up to
date".
- `dispatch-gates --ran`: "119 derived famil(ies) accounted for — 119
run, 0 NOT-MEASURED".
- Dogfood battery: not run (no `!` in the title, no `(narrowing)` arm).
- CI owns the rest (lint farm, Test Core including `test:repo`, Test UI,
Build Core).

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5mF5zkznDPYTZjWWqa

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5mF5zkznDPYTZjWWqa)_

<!-- signed: domain:spec#4 · os-project-manager ·
session_01FEkQ5mecqk8M5q9vjKj6aS -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…over a child field that is not a stored home amount, in defineStack's words (objectstack-ai#33855)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XThUCLpnVeG2WSghJgQjdG7)_

domain:spec#4 · os-project-manager · session_01FEkQ5nU2dZbC2HWMg47r4D

Fixes objectstack-ai#33713

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — `skills/**` teaches no `dynamic` roll-up yet (its
home roll-up paragraph is owed by follow-up objectstack-ai#33714), so no page states
which door refuses the wrong one.

## 维护者速读

- 改了什么:运行中的服务器上,单对象保存/发布(元数据 API)现在和 `defineStack` 一样,拒绝"声明
`currencyMode: 'dynamic'`、却汇总的不是子对象本位币金额字段"的汇总字段,返回 422
`INVALID_METADATA`,提示原文与 `defineStack`
完全一致(同一份拼写)。扩展(`object_extension`)加进来的汇总或子字段,按服务器实际提供的对象来判;子对象上的
`homeAmount` 只有在其声明本身合法时才算数,扩展无法把普通数字字段"冒充"成本位币字段。
- 为什么改:objectstack-ai#33710 放开了"本位币汇总声明 dynamic",但只在 `defineStack` 判子字段;单对象保存那道门只判
`record` 汇总,于是汇总固定 EUR 金额、普通数字或公式的 dynamic 汇总能被存下,页面用本位币符号显示其合计,币种是错的。
- 风险与回滚:收窄的只是 objectstack-ai#33710 刚放开、尚未进任何稳定版(最新稳定版 18.4.0 不含)的形状;合法的本位币汇总照常保存。回滚即
revert 本 PR。
- 先看:`packages/objectql/src/record-currency-aggregate-door.ts` 中
`followRefusalsOf` 新增的两段
(d);`packages/spec/src/data/record-currency-path.ts` 末尾的
`storedHomeAmountSourceOf`(N7 的判据)。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
src/protocol-batch-object-registration.test.ts`,`[objectstack-ai#33713]` 一组 5
项全过(三种错误字段 422、本位币汇总照常保存、扩展加汇总同样 422)。
- 需要你做的:无,席位落地。

## What changes

**S1, the engine door.** `recordCurrencyFollowRefusal`
(`packages/objectql/src/record-currency-aggregate-door.ts`) gains case
(d) beside its `record` case (c). A `summary` with `function` `sum` /
`min` / `max` / `avg` that declares `currencyMode: 'dynamic'`, or a
`currencyConfig` naming no mode, is refused when its child field is not
a stored home amount on the child as this server serves it. It is judged
at both ends, as (c) is: at the parent's save, over a registered child,
and at the child's save, under a registered parent's roll-up (a child
saved so that the roll-up no longer reads a home amount). A child field
the child does not hold is no verdict, as for (c). The refusal is
`RecordCurrencyFollowRefusedError`, the code and status the `record`
refusal already uses: `INVALID_METADATA` / 422. Nothing in the
measurement gave a reason for another code. The pair key is a new kind,
`dynamic`, so a summary moved from a refused `record` declaration to a
refused `dynamic` one is the run's own change (R7).

**One spelling of (d).** The sentence moves from `stack.zod.ts` into
`packages/spec/src/data/record-currency-path.ts`, which already shares
(a) and (c), as `recordCurrencyDynamicRollupNotHomeError`. `defineStack`
and the engine both print it. The file is already exported from
`@objectstack/spec/data`, so the data barrel is untouched. Its two new
exports appear in `api-surface/data.json` and
`export-origins/data.json`.

**N7.** `storedHomeAmountSourceOf` (same file) replaces
`homeAmountSourceOf`, at both doors. A `homeAmount` makes its `field` a
stored home amount only where it is valid as declared, which is the
object door's reading in `refuseDishonestHomeAmount`. It must sit on a
`record`-mode `currency` amount and name another field of the same map.
That field must be a `currency` field in `dynamic` mode (an absent mode
is `dynamic`), `readonly: true`, with no `expression`, and claimed by
that one amount. An authored object already guarantees this, so
`defineStack` answers the same for every stack whose fields are all
authored. A map merged with an extension's fields, or an object as a
server serves it, can no longer launder a plain number, a `fixed`
amount, a writable or computed field, or a doubly claimed column. The
candidate list in the refusal now names only valid home amounts.

**N6.** No registration path was added and `registry.ts` is untouched.
Since objectstack-ai#33621 the follow door is asked with the object as served
(`servedFoldWithLayer`). That covers an `extend` layer in its slot, and
a `lookup` that returns the served child with every enabled extension.
It is asked at a single save, in the batch writer and at the end of a
registration run. So the new arm judges a roll-up an extension adds to a
parent, and a child field an extension adds, by that same path.
`defineStack` still skips an end it knows only through an extension,
because it cannot see that object's owner. Its docblock now says the
engine judges such a pair at the end of the run that installs the stack.

**N1.** The `FieldSchema.currencyConfig` `.describe()` now says the
roll-ups it lists are refused "by `defineStack` and by a single-object
save or publish on a running server alike". The reference pages are
regenerated.

**Docs (surface amendment 6893463231).**
`content/docs/data-modeling/currency.mdx` had two sentences from objectstack-ai#33710
saying a single-object save "does not judge the child field yet
(objectstack-ai#33713)". This fix makes both false, so both now state the 422 at the
metadata API, as the `record` bullet beside them does.

**Liveness.** `field/currencyConfig` gains a dated `NARROWED 2026-11-15
(objectstack-ai#33713 …)` line naming the new reader and the shared spelling. The
verdict stays LIVE.

**ADR-0087.** One semantic entry,
`summary-dynamic-currency-rollup-home-amount-judged-as-served`, and the
changeset carries `adr-0087: registered` with it. It is owed for the
measurement below. The gate would also refuse `not-required
(no-migration-prescription)` on any `Metadata-protocol: narrowed`
changeset.

## Tests

- `packages/objectql/src/protocol-batch-object-registration.test.ts`,
new describe `[objectstack-ai#33713]` (real kernel, real registry, `saveMetaItem`
published on the `meta-envelope` face):
- A `dynamic` roll-up over a `fixed` EUR amount, a plain number and a
formula is refused 422 `INVALID_METADATA`
(`RecordCurrencyFollowRefusedError`). The message opens with the case
(d) sentence, and nothing is stored or registered.
- CONTROL: the objectstack-ai#33659 probe shape, a `dynamic` roll-up of `amount_home`,
saves and is served.
- CONTROL: a `count` roll-up and a roll-up declaring no currency save as
before.
- A `record` roll-up over the fixed amount answers as before, 422 with
(c)'s sentence.
- N6: an `object_extension` item adding the roll-up is refused 422 and
stores nothing.
- `packages/objectql/src/record-currency-guards.test.ts`, new describe
for case (d), at the registry's single-save question:
- The three child fields are refused whichever end registers second.
Each message is EQUAL to `defineStack`'s finding for the same pair, so
the wording is pinned at both doors.
  - A `{}` config and `min` / `max` / `avg` are refused the same way.
- A roll-up over the record-mode amount itself stays D6's first
(`RecordCurrencySummaryRefusedError`), pinned and not re-judged.
- CONTROL: the probe shape registers in either order for all four
functions. No-currency and `fixed` roll-ups are not judged.
- A child save that de-homes a registered roll-up's field is refused,
naming the parent's roll-up. A registration run that leaves an old pair
as it found it is not refused (R7), and one that de-homes it is.
- N6: an extension adding the roll-up is refused at a single save. An
extension adding the child field is judged at either end. A post-seal
`registerApp` whose `objectExtensions` add the roll-up is refused at the
end of its run and leaves nothing of the package.
- N7: an extension forging `homeAmount` over a plain number does not
admit the roll-up, and its message equals `defineStack`'s. CONTROL: an
extension with its own valid home field and amount does admit it.
- `packages/spec/src/data/currency-summary-home-rollup.test.ts`, two new
describes:
- N7 at `defineStack`: an `objectExtensions` entry forging `homeAmount`
over a writable amount, a `number` field, a `fixed` amount, a computed
field, or a doubly claimed home field is refused. A valid extension home
amount is admitted. `storedHomeAmountSourceOf` over the parsed probe
child answers `amount` for `amount_home` and nothing for every other
field.
- Wording: `defineStack`'s finding equals
`recordCurrencyDynamicRollupNotHomeError(...)` for four child fields.
- **Ablations** (mutation through `scripts/ablation-replace.mjs`,
restored to the HEAD blob each time, `git diff HEAD` empty):
- Dynamic arm: `declaresDynamicCurrency` forced false in
`record-currency-aggregate-door.ts`. 9 tests red (2 metadata-API, 7
registry). All controls stayed green.
- N7 check: `storedHomeAmountSourceOf` put back to the old
any-`homeAmount` reading. Spec was rebuilt and `ablation-dist-preflight`
found the marker in 2 dist files. 3 spec tests and 2 objectql tests went
red. After the restore, spec was rebuilt and the preflight `--absent`
read clean.

## Acceptance notes

- **The migration measurement.** The latest stable `@objectstack/spec`,
18.4.0 (published 2026-11-13T12:30Z), does not carry objectstack-ai#33710: none of its
tarball's files hold the object door's new wording. The `next` snapshot
`0.0.0-next-20261115100430` (dist-tag `next`, published
2026-11-15T10:32Z, `gitHead` bd96ec9) does: 4 dist files hold it. That
is a published version with the widening, so the entry is added. Against
the last stable release, the net change is still a widening (18.4.0
refused every `dynamic` summary).
- **A single save does not apply R7.** A single save judges its layer
against an empty slot (`before: null`), as it already does for (a) and
(c). So once a bad `dynamic` roll-up is stored past this door (stored
before this release and hydrated at boot), re-saving the child unchanged
through `/meta` is refused over it. A registration run compares the pair
and does not refuse it. The test pins the run's half.
- **(d) does not read `rateDate` / `rateField`.** They say nothing about
which currency the home field holds. The object door still judges them
on an authored object.
- **N2 is unchanged.** On the engine, D6's roll-up door answers first
for a roll-up over an amount in each row's own currency. For an amount
that follows the parent through the very `master_detail`, D6 admits the
roll-up and (d) refuses it in `defineStack`'s words, the same order the
stack pass has.
- `packages/objectql/src/registry.ts`'s comment above the single-save
follow question still names only the following amount and the `record`
roll-up. It is outside the surface (`registry.ts` was granted for an N6
call site only, and none was needed). Noted, not edited.

## Verification

All readings on head `c6d372dc` (base `b76df9a6`; `origin/main` is 19
commits ahead, none touching this diff's files).

<details><summary>Package suites, typecheck, dogfood</summary>

- `pnpm --filter @objectstack/spec test`: Test Files 842 passed (842),
Tests 26948 passed, 1 todo.
- `pnpm --filter @objectstack/objectql test`: Test Files 596 passed
(596), Tests 13151 passed.
- `pnpm --filter @objectstack/spec typecheck && pnpm --filter
@objectstack/objectql typecheck`: exit 0.
- Full dogfood battery (owed by the `(narrowing)` arm), `pnpm --filter
@objectstack/dogfood test` under the lock after the closure build:
`VERDICT command-exit 0`, Test Files 467 passed, 3 skipped (470), Tests
3958 passed, 42 skipped (4000).

</details>

<details><summary>Derived gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 121 commands. Each was run with its exit
code captured before any pipe.
- 119 passed on the first pass. `check:dual-build-cjs-loads` and
`check:published-readme-exports` answered exit 3 (PREREQUISITE NOT MET:
six packages outside this diff had no `dist/`). After building them,
both exit 0.
- `--ran`: `121 derived famil(ies) accounted for — 121 run, 0
NOT-MEASURED`.
- `pnpm --filter @objectstack/spec check:generated`: exit 0 after
`gen:api-surface`, `gen:export-origins`, `gen:schema` and `gen:docs`.
- The log is `pm-orders/spec/33713-gates-ran.txt`. CI runs every other
family.

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (CI).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5nU2dZbC2HWMg47r4D)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…r key, and a route serves the one on its key (objectstack-ai#33821)

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — `skills/**` and `content/docs/**` already teach that
an action is keyed by its package, its object and its name, and that the
router reaches an action bound to the object before an object-less one;
no authored key, value or meaning changes.

## 维护者速读

- 改了什么:注册表为无包 action 按「归属对象」各留一格:平台绑定 `lead` 的 action 与环境的无对象 action
同名时两者都保留,不论注册先后;`/actions/lead/NAME` 读绑定 `lead` 的那条,其它路由读环境的无对象那条。
- 为什么改:action 的身份是(归属方、归属对象、名称),同名不同键是两条
action;路由判定所用的声明和派发执行的处理器必须来自同一条。
- 风险与回滚:只动 `action` 类型的无包槽位与 action 路由的选取,单条无包 action
的存储与读法不变(有对照测试);回滚即 revert 本 PR。
-
先看:`packages/objectql/src/registry.ts`(`keepPackagelessActionOwnerKeys`
与移除时的
`packagelessActionEntryToRetire`)、`packages/runtime/src/action-execution.ts`(`packagelessActionOnRouteBeside`)、`packages/runtime/src/action-package-addressing.test.ts`
末尾的新 describe。
- 两分钟验证:`pnpm --filter @objectstack/runtime exec vitest run
src/action-package-addressing.test.ts -t "own key"`,预期 12 个测试全绿。
- 需要你做的:无,席位落地。

## What changes

Rule: an action is identified by `(owner, owning object, name)`
(ADR-0150 D4). The platform's package-less action bound to `lead` and
the environment's object-less action of the same name are two items
under two keys, never one contested name. Binding first, then owner:
`/actions/lead/NAME` serves the platform's item bound to `lead`; the
environment's object-less item serves every other route; ADR-0150 D3's
environment-first applies within one key, so the environment changes
`lead` by authoring `NAME` bound to `lead`. On every route the
declaration the gates judge and the handler the dispatch runs are one
item's.

- `packages/objectql/src/registry.ts`: a package-less action registered
over the bare slot keeps the slot's present item when its owner key is
another, in that key's own slot (`keepPackagelessActionOwnerKeys`). One
key keeps one item, the later registration; a stored row replaces the
name's stored row on any key (the environment's store holds one row of a
name). The bare-slot readers (`bareSlotEntriesOf`, `boundServedActions`)
see each key's item; the removal of a stored row retires that row, never
the platform's item of another key, and the next key's item takes the
bare slot. New `getEnvironmentScopedActions(name)`: the
environment-scoped action items of a name, one per owner key.
- `packages/objectql/src/action-package-addressing.ts`,
`package-scoped-resolver.ts`: the owner-key view
(`actionOwnerScopedRegistry`) reads the environment-scoped action on its
own key; `PackageScopedRegistry` gains the optional
`getEnvironmentScopedActions`.
- `packages/runtime/src/action-execution.ts`: the bare route takes the
package-less action on its own key, bound first, then object-less
(`packagelessActionOnRouteBeside`), where the by-name read answered
another key's; beside one package holder the platform's item alone on
the bound rung is served (`platformItemOnBoundRung`); the environment
address `/actions/_env/OBJECT/NAME` answers `404` where another
package-less action of the name is bound to `OBJECT`.
- Not changed: one package-less action of a name (stored and read as
before); beside two package holders elsewhere, `/actions/lead/NAME`
answers what the platform's `lead`-bound item alone answers there (no
declaration); the caller-package route; the stored-row (`sys_metadata`)
model.

## Tests

- `packages/objectql/src/action-package-addressing.test.ts`, new
top-level describe "the registry keeps one package-less action per owner
key": 6 cases (4 pins, 1 one-key pin that holds on main, 1 control).
- `packages/runtime/src/action-package-addressing.test.ts`, new
top-level describe "a route serves the package-less action on its own
key, and runs that item's handler": 12 cases — `lead` serves the
platform's item and runs its handler, and its `requiredPermissions` gate
`lead` (`403 PERMISSION_DENIED`), each in both registration orders
beside 0 and 1 package holders; the environment's object-less item
serves every other route in both orders beside 0, 1 and 2 holders (the
0-holder case a control); beside 2 holders `lead` answers no
declaration; the environment address; controls: one key keeps one item,
each package-less item alone.

## Acceptance notes

- Ablations, one per guard, each through `scripts/ablation-replace.mjs`
(anchor 1 to 0, blob changed), restored to the HEAD blob with `git diff
HEAD` empty:
- registry keep (objectql rebuilt; `ablation-dist-preflight` marker
absent from 8 built files, present in 4 after the restore build):
objectql 4 red / 2 green (the one-key pin and the control), runtime 8
red / 4 green (the controls and the one-key pin).
- the bare route's own-key pick: runtime 2 red (`lead`, 0 holders), 10
green.
- the bound-rung platform pick: runtime 2 red (`lead`, 1 holder), 10
green.
  - the environment address: runtime 1 red, 11 green.
- Two existing pins on the two-holder route (`[objectstack-ai#32751]`, and `case 2` of
`[objectstack-ai#32365]`) keep their answers; the change is scoped so they hold.
- Overlap: PR objectstack-ai#33621 edited `packages/objectql/src/registry.ts` in the
object-extension follow area; it has merged and this branch carries it;
no hunk is shared. None of the 55 open pull requests read before the
open touches the seven files of this diff.

## Verification

All readings on head `8f2c22d91d` (after merging `origin/main`) unless
named.

<details><summary>Package suites and typechecks</summary>

```text
@objectstack/objectql test        Test Files 596 passed (596) · Tests 13142 passed (13142)
@objectstack/runtime test         Test Files 603 passed (603) · Tests 10918 passed | 19 skipped (10937)
objectql + runtime typecheck      tsc --noEmit clean · check:test-typecheck OK for both
@objectstack/spec check:generated All 14 generated artifacts are up to date
before the merge (1f51a01)     objectql 596/596 · 13116 passed; runtime 603/603 · 10886 passed | 19 skipped
```

</details>

<details><summary>Derived gate families (dispatch-gates --commands,
reconciled with --ran)</summary>

```text
head 8f2c22d · 73 derived, 72 exit 0, 1 NOT MEASURED
NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (reads every package's dist/; this tree built the runtime closure only); CI's Lint & Repo Gates run measures it
dispatch-gates --ran: 73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)
```

</details>

<details><summary>Dogfood battery</summary>

```text
8f2c22d · os-verify-lock VERDICT command-exit 0
pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test
 Test Files  467 passed | 3 skipped (470)
      Tests  3958 passed | 42 skipped (4000)
no failures
```

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f)_

<!-- signed: security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f
-->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant